From duke at openjdk.org Mon Jan 1 17:12:59 2024 From: duke at openjdk.org (Romain Manni-Bucau) Date: Mon, 1 Jan 2024 17:12:59 GMT Subject: RFR: JDK-8306819: Consider disabling the compiler's default active annotation processing [v7] In-Reply-To: References: <2iXdVG-MCaakXx5C5y01mcOFxJNEhoG4o2Fi_KlK8Co=.b500ce4e-7c4b-4d30-b489-f338f86f8af8@github.com> Message-ID: On Fri, 6 Oct 2023 21:55:30 GMT, Joe Darcy wrote: >> Change annotation processing to be opt-in rather than opt-out. > > Joe Darcy has updated the pull request incrementally with one additional commit since the last revision: > > Fix typos. Think there is some reasoning shortcut taken there. The will to avoid to enable annotation processor when not needed is sane and I agree we regularly see apps enabling some of them without needing due to the dependency game/abuse. That said it would be welcomed to take into account 3 points and not only postpone because the community kind of reject this shift - otherwise it will happen again in a few years: 1. Discovery is needed and enable a loose coupling between processor and applications (referencing the class is not great and couple the provider of the processor with all apps setup, this is undesired until a notion of alias is added to annot proc but not sure it is needed). 2. Warning undesired setup (enablement when not needed) is a good thing, if there is a too high cost (`ServiceLoader` one is not since any run will likely trigger a lot of `getResources` and it is fine, even just plain `ToolProvider` to get `javac`) then defaulting to a mode where run fails is better than disabling blindly (`-proc:failIfOverhead` - indeed a better name is welcomed). That said, due to javac code this is hardly explanable so it would better be "fail if explicitly enabled and unused, warn if unused and implicitly enabled" so pretty close to what we have for years and everyone was happy with but a bit stricter for future uses. 3. Annotation processing is a great Javac feature and I don't think it is an option to make it "hard"/verbose to setup (2 maven executions of compiler plugin for example which would make people using it even slower and harder to setup - incremental support is not trivial for people not understanding what happens under the hood). 4. Annotation processing is far to be dead, debatable probably but lombok, immutables, JPA, dagger, (google) auto, jmh, mapstruct, fusion, ... are good example of very living libraries with some serious user base (records don't solve all issues ;)). 5. Annotation processing is a neat way to solve the reflection challenges `native-image` (graalvm) brings. 6. If the generation is not part of the main compilation cycle it enforces to use 2 "load the model" cycle which is often slower (due to the model loading but also the fact it will not use javac internals to rely on a stable API so in terms of classloading it will be worse, in particular in modular systems like maven). 7. All the point about disabling it are security related but this is the wrong way to fix the security of the build for most builds (all using a dependency manager like ivy/gradle, maven/aether cause these builds will keep all the mentionned issues if they don't use the dependency validation which must be done at build level (by design it cant be done at javac level). So overall the original statements should be (in)validated and if there is really an issue using `ServiceLoader` maybe switch to a better SPI option (better to request tools/producers to adjust than consumers) rather than disabling the discovery feature. Side note: not great for users but acceptable if the will is really to disable the discovery, keeping the `full` flag could be an accepable compromise IMHO. ------------- PR Comment: https://git.openjdk.org/jdk/pull/14432#issuecomment-1873404178 From jlahoda at openjdk.org Tue Jan 2 11:17:53 2024 From: jlahoda at openjdk.org (Jan Lahoda) Date: Tue, 2 Jan 2024 11:17:53 GMT Subject: Integrated: 8322159: ThisEscapeAnalyzer crashes for erroneous code In-Reply-To: References: Message-ID: On Fri, 15 Dec 2023 08:10:42 GMT, Jan Lahoda wrote: > When an unresolvable method is used in the code, the model is a bit strange (and not very easy to fix) - for method invocations, the symbol used is actually a `ClassSymbol` instead of `MethodSymbol`, and method references have fields like `kind` unfilled. > > This is causing issues in ThisEscapeAnalyzer when there were unresolvable methods, and the analyzer is called (i.e. in practice when running with `-Xlint:this-escape -XDshould-stop.at=FLOW`, or similar): > - `visitApply` has a hardcoded cast to `MethodSymbol`. Seems the case in not really necessary, so the proposal is to remove it. > - `visitReference` crashes on an access to `JCMemberReference.kind`, as it is unfilled. The proposal is to skip the check if the method reference's type is errneous. This pull request has now been integrated. Changeset: 7455b1b5 Author: Jan Lahoda URL: https://git.openjdk.org/jdk/commit/7455b1b527568aff5b1c16a29fd80b05260c0fad Stats: 44 lines in 2 files changed: 41 ins; 0 del; 3 mod 8322159: ThisEscapeAnalyzer crashes for erroneous code Reviewed-by: vromero ------------- PR: https://git.openjdk.org/jdk/pull/17118 From jlahoda at openjdk.org Tue Jan 2 12:37:58 2024 From: jlahoda at openjdk.org (Jan Lahoda) Date: Tue, 2 Jan 2024 12:37:58 GMT Subject: [jdk22] RFR: 8322159: ThisEscapeAnalyzer crashes for erroneous code Message-ID: Hi all, This pull request contains a backport of commit [7455b1b5](https://github.com/openjdk/jdk/commit/7455b1b527568aff5b1c16a29fd80b05260c0fad) from the [openjdk/jdk](https://git.openjdk.org/jdk) repository. The commit being backported was authored by Jan Lahoda on 2 Jan 2024 and was reviewed by Vicente Romero. Thanks! ------------- Commit messages: - Backport 7455b1b527568aff5b1c16a29fd80b05260c0fad Changes: https://git.openjdk.org/jdk22/pull/26/files Webrev: https://webrevs.openjdk.org/?repo=jdk22&pr=26&range=00 Issue: https://bugs.openjdk.org/browse/JDK-8322159 Stats: 44 lines in 2 files changed: 41 ins; 0 del; 3 mod Patch: https://git.openjdk.org/jdk22/pull/26.diff Fetch: git fetch https://git.openjdk.org/jdk22.git pull/26/head:pull/26 PR: https://git.openjdk.org/jdk22/pull/26 From duke at openjdk.org Tue Jan 2 14:40:57 2024 From: duke at openjdk.org (Oliver Kopp) Date: Tue, 2 Jan 2024 14:40:57 GMT Subject: RFR: JDK-8298405: Support Markdown in the standard doclet [v7] In-Reply-To: References: Message-ID: On Tue, 21 Feb 2023 17:06:59 GMT, Jonathan Gibbons wrote: >> Jonathan Gibbons has updated the pull request incrementally with one additional commit since the last revision: >> >> Revert changes to Object.hashCode > > FYI, the PR has been withdrawn for now, pending additional design discussions. Thank you so much for the work @jonathan-gibbons and @lahodaj (for the jshell part). I can see the need for an universal solution allow to handle both Markdown and ASCIIDoc. However, offering Markdown would be a huge improvement compared to the existing solution (having to use HTML and IDE support took a long time to fix "trivial" things - e.g., proper HTML reformat https://youtrack.jetbrains.com/issue/IDEA-147601). ------------- PR Comment: https://git.openjdk.org/jdk/pull/11701#issuecomment-1874106337 From jlahoda at openjdk.org Tue Jan 2 15:05:57 2024 From: jlahoda at openjdk.org (Jan Lahoda) Date: Tue, 2 Jan 2024 15:05:57 GMT Subject: RFR: 8322003: JShell - Incorrect type inference in lists of records implementing interfaces Message-ID: Consider JShell snippet like: var v = List.of("", 0); The type of `v` is along the lines of `List&java.lang.constant.Constable&java.lang.constant.ConstantDesc>&java.lang.constant.Constable&java.lang.constant.ConstantDesc>` - i.e. a List with an intersection type as a type argument. The problem is that JShell compiles snippets separately in separate classes. And hence `v` is upgraded to a field. But, the field cannot have the above non-denotable type, so its type is demoted to `List`. When the field is read when a subsequent snippet is processed, JShell tries to reconstitute the type, but a type with an intersection type as a type argument cannot be parsed by the parser. As a consequence, continuing with the example above: jshell> List l = v; | Error: | incompatible types: java.util.List cannot be converted to java.util.List | List l = v; | ^ The proposed solution here is to enhance the parser used by JShell so that it can parse intersection types at any position. JShell then can reconstitute the type, and the above snippets work: jshell> var v = List.of("", 0); v ==> [, 0] jshell> List l = v; l ==> [, 0] ------------- Commit messages: - 8322003: JShell - Incorrect type inference in lists of records implementing interfaces Changes: https://git.openjdk.org/jdk/pull/17223/files Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=17223&range=00 Issue: https://bugs.openjdk.org/browse/JDK-8322003 Stats: 121 lines in 3 files changed: 87 ins; 11 del; 23 mod Patch: https://git.openjdk.org/jdk/pull/17223.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/17223/head:pull/17223 PR: https://git.openjdk.org/jdk/pull/17223 From darcy at openjdk.org Tue Jan 2 22:33:55 2024 From: darcy at openjdk.org (Joe Darcy) Date: Tue, 2 Jan 2024 22:33:55 GMT Subject: RFR: JDK-8322248: Fix inconsistent wording in ElementFilter.typesIn Message-ID: <87cdXflxg25vKZKLqzzq8_ViaTRmQP1MaEage4_2t2U=.30478712-609f-40b1-a2db-e5ee9cb3d51d@github.com> Correct small oversight made during the fix for JDK-8257638: Update usage of "type" terminology in javax.lang.model ------------- Commit messages: - JDK-8322248: Fix inconsistent wording in ElementFilter.typesIn Changes: https://git.openjdk.org/jdk/pull/17231/files Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=17231&range=00 Issue: https://bugs.openjdk.org/browse/JDK-8322248 Stats: 2 lines in 1 file changed: 0 ins; 0 del; 2 mod Patch: https://git.openjdk.org/jdk/pull/17231.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/17231/head:pull/17231 PR: https://git.openjdk.org/jdk/pull/17231 From jjg at openjdk.org Tue Jan 2 22:33:56 2024 From: jjg at openjdk.org (Jonathan Gibbons) Date: Tue, 2 Jan 2024 22:33:56 GMT Subject: RFR: JDK-8322248: Fix inconsistent wording in ElementFilter.typesIn In-Reply-To: <87cdXflxg25vKZKLqzzq8_ViaTRmQP1MaEage4_2t2U=.30478712-609f-40b1-a2db-e5ee9cb3d51d@github.com> References: <87cdXflxg25vKZKLqzzq8_ViaTRmQP1MaEage4_2t2U=.30478712-609f-40b1-a2db-e5ee9cb3d51d@github.com> Message-ID: <0H1AEAl92b-7tN6HFqEtcNa7Qx9bbkyZ4XmnNlEx1eY=.3d8bbd94-fdfa-4116-af03-8ff896fd773d@github.com> On Tue, 2 Jan 2024 22:28:51 GMT, Joe Darcy wrote: > Correct small oversight made during the fix for > > JDK-8257638: Update usage of "type" terminology in javax.lang.model Marked as reviewed by jjg (Reviewer). ------------- PR Review: https://git.openjdk.org/jdk/pull/17231#pullrequestreview-1801170498 From iris at openjdk.org Tue Jan 2 22:53:46 2024 From: iris at openjdk.org (Iris Clark) Date: Tue, 2 Jan 2024 22:53:46 GMT Subject: RFR: JDK-8322248: Fix inconsistent wording in ElementFilter.typesIn In-Reply-To: <87cdXflxg25vKZKLqzzq8_ViaTRmQP1MaEage4_2t2U=.30478712-609f-40b1-a2db-e5ee9cb3d51d@github.com> References: <87cdXflxg25vKZKLqzzq8_ViaTRmQP1MaEage4_2t2U=.30478712-609f-40b1-a2db-e5ee9cb3d51d@github.com> Message-ID: On Tue, 2 Jan 2024 22:28:51 GMT, Joe Darcy wrote: > Correct small oversight made during the fix for > > JDK-8257638: Update usage of "type" terminology in javax.lang.model Marked as reviewed by iris (Reviewer). ------------- PR Review: https://git.openjdk.org/jdk/pull/17231#pullrequestreview-1801184493 From darcy at openjdk.org Tue Jan 2 23:08:52 2024 From: darcy at openjdk.org (Joe Darcy) Date: Tue, 2 Jan 2024 23:08:52 GMT Subject: Integrated: JDK-8322248: Fix inconsistent wording in ElementFilter.typesIn In-Reply-To: <87cdXflxg25vKZKLqzzq8_ViaTRmQP1MaEage4_2t2U=.30478712-609f-40b1-a2db-e5ee9cb3d51d@github.com> References: <87cdXflxg25vKZKLqzzq8_ViaTRmQP1MaEage4_2t2U=.30478712-609f-40b1-a2db-e5ee9cb3d51d@github.com> Message-ID: On Tue, 2 Jan 2024 22:28:51 GMT, Joe Darcy wrote: > Correct small oversight made during the fix for > > JDK-8257638: Update usage of "type" terminology in javax.lang.model This pull request has now been integrated. Changeset: fcf8368e Author: Joe Darcy URL: https://git.openjdk.org/jdk/commit/fcf8368eb1945c440df8f38969849621b4fffc50 Stats: 2 lines in 1 file changed: 0 ins; 0 del; 2 mod 8322248: Fix inconsistent wording in ElementFilter.typesIn Reviewed-by: jjg, iris ------------- PR: https://git.openjdk.org/jdk/pull/17231 From cushon at openjdk.org Wed Jan 3 23:29:40 2024 From: cushon at openjdk.org (Liam Miller-Cushon) Date: Wed, 3 Jan 2024 23:29:40 GMT Subject: RFR: JDK-8042981: Strip type annotations in Types' utility methods [v2] In-Reply-To: References: Message-ID: On Sun, 26 Jun 2022 22:52:43 GMT, Joe Darcy wrote: >> Early review for JDK-8042981: "Strip type annotations in Types' utility methods". I work more often in the Element world rather than the Type word of the annotation processing APIs. >> >> The type annotations on primitive types are *not* cleared by the existing annotation clearing mechanisms. I suspect Type.Visitor is missing a case for primitive types. Someone with familiarity with javac's type modeling should take a look; thanks. > > Joe Darcy 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 three additional commits since the last revision: > > - Update visitor; all langtools regression tests pass. > - Merge branch 'master' into JDK-8042981 > - JDK-8042981: Strip type annotations in Types' utility methods I cleaned up the approach described in https://github.com/openjdk/jdk/pull/8984#issuecomment-1806211798 and have a draft with those changes applied on top of the work in this PR: https://github.com/openjdk/jdk/pull/17256. It passes the tests added in this PR, with the disabled cases re-enabled. @jddarcy what do you think of that approach? ------------- PR Comment: https://git.openjdk.org/jdk/pull/8984#issuecomment-1876104743 From jlahoda at openjdk.org Fri Jan 5 12:46:25 2024 From: jlahoda at openjdk.org (Jan Lahoda) Date: Fri, 5 Jan 2024 12:46:25 GMT Subject: [jdk22] Integrated: 8321582: yield .class not parsed correctly. In-Reply-To: <8h-h23rMlK-NCG04lFOcYNU5-w5noQBovgI-OXvZ1to=.981ddd89-be9c-4d2b-9f26-7dce664c9a60@github.com> References: <8h-h23rMlK-NCG04lFOcYNU5-w5noQBovgI-OXvZ1to=.981ddd89-be9c-4d2b-9f26-7dce664c9a60@github.com> Message-ID: On Mon, 11 Dec 2023 12:47:10 GMT, Jan Lahoda wrote: > Hi all, > > This pull request contains a backport of commit [ce8399fd](https://github.com/openjdk/jdk/commit/ce8399fd6071766114f5f201b6e44a7abdba9f5a) from the [openjdk/jdk](https://git.openjdk.org/jdk) repository. > > The commit being backported was authored by Jan Lahoda on 11 Dec 2023 and was reviewed by Vicente Romero. > > Thanks! This pull request has now been integrated. Changeset: bb0e203d Author: Jan Lahoda URL: https://git.openjdk.org/jdk22/commit/bb0e203d134b35bb1078c3be10f7a6952f6c75bc Stats: 29 lines in 2 files changed: 27 ins; 1 del; 1 mod 8321582: yield .class not parsed correctly. Reviewed-by: shade, vromero Backport-of: ce8399fd6071766114f5f201b6e44a7abdba9f5a ------------- PR: https://git.openjdk.org/jdk22/pull/6 From vromero at openjdk.org Fri Jan 5 17:48:46 2024 From: vromero at openjdk.org (Vicente Romero) Date: Fri, 5 Jan 2024 17:48:46 GMT Subject: RFR: 8322477: order of subclasses in the permits clause can differ between compilations Message-ID: This is a very interesting issue. Given code like: sealed interface Sealed { record R1() implements Sealed {} record R2() implements Sealed {} } As we know javac will infer the `permits` clause of sealed interface `Sealed` logically the order should correspond to the order in which the permitted subclasses appear in the source code. Well it has been consistently observed by the reported of this bug, that some tools like Gradle while doing incremental compilation can make javac infer either `R1, R2` or `R2, R1` as permitted subclasses. The reason is not clear still under investigation on their side but the fact is that javac is generating inconsistent output for some classes with this shape. The proposed solution is to store the position of the permitted subclasses being discovered by javac so that the order of the permitted subclasses corresponds to the original order in the source file. Efforts to reduce the project where the issue was discovered to a small reproductor have been unsuccessful but the proposed patch have fixed the issue observed by the reporter. TIA ------------- Commit messages: - 8322477: order of subclasses in the permits clause can differ between compilations Changes: https://git.openjdk.org/jdk/pull/17284/files Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=17284&range=00 Issue: https://bugs.openjdk.org/browse/JDK-8322477 Stats: 76 lines in 8 files changed: 38 ins; 0 del; 38 mod Patch: https://git.openjdk.org/jdk/pull/17284.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/17284/head:pull/17284 PR: https://git.openjdk.org/jdk/pull/17284 From vromero at openjdk.org Fri Jan 5 17:57:22 2024 From: vromero at openjdk.org (Vicente Romero) Date: Fri, 5 Jan 2024 17:57:22 GMT Subject: RFR: 8322477: order of subclasses in the permits clause can differ between compilations In-Reply-To: References: Message-ID: On Fri, 5 Jan 2024 17:42:33 GMT, Vicente Romero wrote: > This is a very interesting issue. Given code like: > > sealed interface Sealed { > record R1() implements Sealed {} > record R2() implements Sealed {} > } > > > As we know javac will infer the `permits` clause of sealed interface `Sealed` logically the order should correspond to the order in which the permitted subclasses appear in the source code. Well it has been consistently observed by the reported of this bug, that some tools like Gradle while doing incremental compilation can make javac infer either `R1, R2` or `R2, R1` as permitted subclasses. The reason is not clear still under investigation on their side but the fact is that javac is generating inconsistent output for some classes with this shape. The proposed solution is to store the position of the permitted subclasses being discovered by javac so that the order of the permitted subclasses corresponds to the original order in the source file. Efforts to reduce the project where the issue was discovered to a small reproductor have been unsuccessful but the proposed patch have fixed the issue observed by the reporter. > > TIA src/jdk.compiler/share/classes/com/sun/tools/javac/code/Symbol.java line 1307: > 1305: /** The classes, or interfaces, permitted to extend this class, or interface > 1306: */ > 1307: private java.util.List permitted; some of the changes come only because of the fact that this field is not private. We can keep it public and the code will be simpler but there could be erroneous uses of the field ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/17284#discussion_r1443183930 From vromero at openjdk.org Fri Jan 5 18:00:23 2024 From: vromero at openjdk.org (Vicente Romero) Date: Fri, 5 Jan 2024 18:00:23 GMT Subject: RFR: 8322477: order of subclasses in the permits clause can differ between compilations In-Reply-To: References: Message-ID: On Fri, 5 Jan 2024 17:42:33 GMT, Vicente Romero wrote: > This is a very interesting issue. Given code like: > > sealed interface Sealed { > record R1() implements Sealed {} > record R2() implements Sealed {} > } > > > As we know javac will infer the `permits` clause of sealed interface `Sealed` logically the order should correspond to the order in which the permitted subclasses appear in the source code. Well it has been consistently observed by the reported of this bug, that some tools like Gradle while doing incremental compilation can make javac infer either `R1, R2` or `R2, R1` as permitted subclasses. The reason is not clear still under investigation on their side but the fact is that javac is generating inconsistent output for some classes with this shape. The proposed solution is to store the position of the permitted subclasses being discovered by javac so that the order of the permitted subclasses corresponds to the original order in the source file. Efforts to reduce the project where the issue was discovered to a small reproductor have been unsuccessful but the proposed patch have fixed the issue observed by the reporter. > > TIA src/jdk.compiler/share/classes/com/sun/tools/javac/comp/Attr.java line 5393: > 5391: Set permittedTypes = new HashSet<>(); > 5392: boolean sealedInUnnamed = c.packge().modle == syms.unnamedModule || c.packge().modle == syms.noModule; > 5393: for (Type subType : c.getPermittedSubclasses()) { most changes here are due to the use of `getPermittedSubclasses`, which is a previously existing API, that returns a list of types. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/17284#discussion_r1443188628 From jlahoda at openjdk.org Fri Jan 5 19:56:41 2024 From: jlahoda at openjdk.org (Jan Lahoda) Date: Fri, 5 Jan 2024 19:56:41 GMT Subject: RFR: 8323057: Recoverable errors may be reported before unrecoverable errors when annotation processing is skipped Message-ID: When annotation processing is requested, some errors reported during enter may be resolved by the annotation processors. So, javac stashes the errors from enter aside. When an error that cannot be resolved by annotation processing is found in the stashed errors, the annotation processors all the errors will be printed. This may be confusing if there's one important non-resolvable error, hidden among many errors that would be resolved by the annotation processors. The proposal herein is therefore to first print the not-recoverable errors, and only then the recoverable errors, when the errors are stashed away and then re-printed. ------------- Commit messages: - 8323057: Recoverable errors may be reported before unrecoverable errors when annotation processing is skipped Changes: https://git.openjdk.org/jdk/pull/17286/files Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=17286&range=00 Issue: https://bugs.openjdk.org/browse/JDK-8323057 Stats: 152 lines in 4 files changed: 134 ins; 11 del; 7 mod Patch: https://git.openjdk.org/jdk/pull/17286.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/17286/head:pull/17286 PR: https://git.openjdk.org/jdk/pull/17286 From jlahoda at openjdk.org Fri Jan 5 20:00:57 2024 From: jlahoda at openjdk.org (Jan Lahoda) Date: Fri, 5 Jan 2024 20:00:57 GMT Subject: RFR: 8322003: JShell - Incorrect type inference in lists of records implementing interfaces [v2] In-Reply-To: References: Message-ID: > Consider JShell snippet like: > > var v = List.of("", 0); > > > The type of `v` is along the lines of `List&java.lang.constant.Constable&java.lang.constant.ConstantDesc>&java.lang.constant.Constable&java.lang.constant.ConstantDesc>` - i.e. a List with an intersection type as a type argument. > > The problem is that JShell compiles snippets separately in separate classes. And hence `v` is upgraded to a field. But, the field cannot have the above non-denotable type, so its type is demoted to `List`. When the field is read when a subsequent snippet is processed, JShell tries to reconstitute the type, but a type with an intersection type as a type argument cannot be parsed by the parser. As a consequence, continuing with the example above: > > jshell> List l = v; > | Error: > | incompatible types: java.util.List cannot be converted to java.util.List > | List l = v; > | ^ > > > The proposed solution here is to enhance the parser used by JShell so that it can parse intersection types at any position. JShell then can reconstitute the type, and the above snippets work: > > jshell> var v = List.of("", 0); > v ==> [, 0] > > jshell> List l = v; > l ==> [, 0] Jan Lahoda has updated the pull request with a new target base due to a merge or a rebase. The pull request now contains two commits: - Merge branch 'master' into JDK-8322003 - 8322003: JShell - Incorrect type inference in lists of records implementing interfaces ------------- Changes: https://git.openjdk.org/jdk/pull/17223/files Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=17223&range=01 Stats: 121 lines in 3 files changed: 87 ins; 11 del; 23 mod Patch: https://git.openjdk.org/jdk/pull/17223.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/17223/head:pull/17223 PR: https://git.openjdk.org/jdk/pull/17223 From cushon at google.com Fri Jan 5 20:56:51 2024 From: cushon at google.com (Liam Miller-Cushon) Date: Fri, 5 Jan 2024 12:56:51 -0800 Subject: diagnostics for non-applicable type annotations Message-ID: Hello, JDK-8043226 is a long-standing bug about the diagnostics for non-applicable type annotations. This is an example of a current diagnostic: test/langtools/tools/javac/annotations/typeAnnotations/failures/CantAnnotateScoping.java:38: error: scoping construct cannot be annotated with type-use annotation: @TA @TA Outer.SInner osi; ^ Users troubleshooting these diagnostics sometimes find them hard to resolve, because it isn't intuitive which location is an admissible location for the annotation. Additionally, the 'scoping construct' language was used in JSR-308 discussions, but didn't end up in the final version of the specification. I think it would be helpful to users for the diagnostic to mention where a type annotation would be admissible, for example something like: test/langtools/tools/javac/annotations/typeAnnotations/failures/CantAnnotateScoping.java:38: error: type annotations are not admissible at this location: @TA @TA Outer.SInner osi; ^ (to annotate a qualified type, write Outer. at TA SInner) I have a PR to implement the revised diagnostic here: https://github.com/openjdk/jdk/pull/16592 Do you think the revised diagnostics are an improvement? Are there any suggestions for language that would be better? Any feedback on the idea is welcome. Thanks, Liam -------------- next part -------------- An HTML attachment was scrubbed... URL: From vromero at openjdk.org Fri Jan 5 21:01:24 2024 From: vromero at openjdk.org (Vicente Romero) Date: Fri, 5 Jan 2024 21:01:24 GMT Subject: RFR: 8322003: JShell - Incorrect type inference in lists of records implementing interfaces [v2] In-Reply-To: References: Message-ID: On Fri, 5 Jan 2024 20:00:57 GMT, Jan Lahoda wrote: >> Consider JShell snippet like: >> >> var v = List.of("", 0); >> >> >> The type of `v` is along the lines of `List&java.lang.constant.Constable&java.lang.constant.ConstantDesc>&java.lang.constant.Constable&java.lang.constant.ConstantDesc>` - i.e. a List with an intersection type as a type argument. >> >> The problem is that JShell compiles snippets separately in separate classes. And hence `v` is upgraded to a field. But, the field cannot have the above non-denotable type, so its type is demoted to `List`. When the field is read when a subsequent snippet is processed, JShell tries to reconstitute the type, but a type with an intersection type as a type argument cannot be parsed by the parser. As a consequence, continuing with the example above: >> >> jshell> List l = v; >> | Error: >> | incompatible types: java.util.List cannot be converted to java.util.List >> | List l = v; >> | ^ >> >> >> The proposed solution here is to enhance the parser used by JShell so that it can parse intersection types at any position. JShell then can reconstitute the type, and the above snippets work: >> >> jshell> var v = List.of("", 0); >> v ==> [, 0] >> >> jshell> List l = v; >> l ==> [, 0] > > Jan Lahoda has updated the pull request with a new target base due to a merge or a rebase. The pull request now contains two commits: > > - Merge branch 'master' into JDK-8322003 > - 8322003: JShell - Incorrect type inference in lists of records implementing interfaces lgtm ------------- Marked as reviewed by vromero (Reviewer). PR Review: https://git.openjdk.org/jdk/pull/17223#pullrequestreview-1806836651 From cushon at openjdk.org Fri Jan 5 21:15:21 2024 From: cushon at openjdk.org (Liam Miller-Cushon) Date: Fri, 5 Jan 2024 21:15:21 GMT Subject: RFR: 8043226: Better diagnostics for non-applicable type annotations In-Reply-To: References: Message-ID: On Fri, 10 Nov 2023 01:21:28 GMT, Liam Miller-Cushon wrote: > Hi, > > Please consider this improvement to diagnostics on inadmissable type annotations. > > [JDK-8057683: clarify error messages trying to annotate scoping](https://bugs.openjdk.org/browse/JDK-8057683) is closely related to JDK-8043226 and I think could be made a duplicate of that bug. [JDK-8057683: improve ordering of errors with type annotations](https://bugs.openjdk.org/browse/JDK-8057683) is also closely related, and this PR partially fixes the issues described in that bug. > > I have some notes on details of the proposed changes below. > > --- > > Currently javac reports 'scoping construct cannot be annotated' diagnostics for type annotations at locations where they are not admissable. > > As discussed in [JDK-8043226](https://bugs.openjdk.org/browse/JDK-8043226) and [JDK-8057683](https://bugs.openjdk.org/browse/JDK-8057683), the current language is unclear. The 'scoping construct' language was used in JSR-308 discussions but didn't end up in the final specification, JLS ?9.7.4 talks about where annotations are 'admissable', and that language is mirrored in JVMS ?4.7.20.2. > > This change updates the diagnostics to state that type annotations 'not admissible at this location' and removed the reference to 'scoping constructs'. Additionally, the diagnostic now includes an explanation of a location in the type where annotations would be admissible, to make it easier to understand how to annotate qualified type names. > > Before: > > > test/langtools/tools/javac/annotations/typeAnnotations/failures/CantAnnotateScoping.java:38: error: scoping construct cannot be annotated with type-use annotation: @TA > @TA Outer.SInner osi; > ^ > > > After: > > > test/langtools/tools/javac/annotations/typeAnnotations/failures/CantAnnotateScoping.java:38: error: type annotations are not admissible at this location: @TA > @TA Outer.SInner osi; > ^ > (to annotate a qualified type, write Outer. at TA SInner) > > > --- > > Attribution currently assumes `@TA java.lang.Object` in `List<@TA java.lang.Object>` will be a type (not a package), and reports a resolution failure when it can't find a class named `java`. > > This change modifies attribution to search for packages as well as types when resolving annotated types, and relies on the subsequent error checking for annotated types to report that type annotations are not admissible at that location. > > This also improves the ordering of the diagnostic in the output, since attribution errors are report before type annotation validation errors in the l... Please keep this open ------------- PR Comment: https://git.openjdk.org/jdk/pull/16592#issuecomment-1879261789 From tschatzl at openjdk.org Mon Jan 8 13:28:29 2024 From: tschatzl at openjdk.org (Thomas Schatzl) Date: Mon, 8 Jan 2024 13:28:29 GMT Subject: RFR: 8323181: JavadocHelperTest.java OOMEs with Parallel GC and ZGC Message-ID: Hi all, please review this small fix to increase max heap size for the test to let it pass with GenZGC and Parallel GC as well. The test has at least 660m of live data, so the default 768m provided by testng is too small for these collectors. Testing: local testing Hth, Thomas ------------- Commit messages: - increase max heap size to let the test pass Changes: https://git.openjdk.org/jdk/pull/17304/files Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=17304&range=00 Issue: https://bugs.openjdk.org/browse/JDK-8323181 Stats: 1 line in 1 file changed: 0 ins; 0 del; 1 mod Patch: https://git.openjdk.org/jdk/pull/17304.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/17304/head:pull/17304 PR: https://git.openjdk.org/jdk/pull/17304 From prappo at openjdk.org Mon Jan 8 13:49:31 2024 From: prappo at openjdk.org (Pavel Rappo) Date: Mon, 8 Jan 2024 13:49:31 GMT Subject: RFR: JDK-8298405: Support Markdown in Documentation Comments [v5] In-Reply-To: <5D_gyGHDR52UTLCcFnUNSWYXjYgcy3jYnffOXZ70xsg=.e1389d08-c9ae-481f-9c53-1ccd1e389102@github.com> References: <5D_gyGHDR52UTLCcFnUNSWYXjYgcy3jYnffOXZ70xsg=.e1389d08-c9ae-481f-9c53-1ccd1e389102@github.com> Message-ID: <-A138lUTDM768TSi4KH0VYzBEoEDUOnADjSCL_RRgKA=.ab4b9b97-47a8-474a-bc64-4b461988bbe4@github.com> On Wed, 15 Nov 2023 18:58:43 GMT, Jonathan Gibbons wrote: >> Please review a patch to add support for Markdown syntax in documentation comments, as described in the associated JEP. >> >> Notable features: >> >> * support for `///` documentation comments in `JavaTokenizer` >> * new module `jdk.internal.md` -- a private copy of the `commonmark-java` library >> * updates to `DocCommentParser` to treat `///` comments as Markdown >> * updates to the standard doclet to render Markdown comments in HTML > > Jonathan Gibbons has updated the pull request incrementally with one additional commit since the last revision: > > Address review comments @jonathan-gibbons, please sync this PR with mainline. As for Skara bots, this comment will hopefully deter them for another 4 weeks. ------------- PR Comment: https://git.openjdk.org/jdk/pull/16388#issuecomment-1881040100 From jlahoda at openjdk.org Mon Jan 8 14:12:30 2024 From: jlahoda at openjdk.org (Jan Lahoda) Date: Mon, 8 Jan 2024 14:12:30 GMT Subject: Integrated: 8322003: JShell - Incorrect type inference in lists of records implementing interfaces In-Reply-To: References: Message-ID: On Tue, 2 Jan 2024 15:00:46 GMT, Jan Lahoda wrote: > Consider JShell snippet like: > > var v = List.of("", 0); > > > The type of `v` is along the lines of `List&java.lang.constant.Constable&java.lang.constant.ConstantDesc>&java.lang.constant.Constable&java.lang.constant.ConstantDesc>` - i.e. a List with an intersection type as a type argument. > > The problem is that JShell compiles snippets separately in separate classes. And hence `v` is upgraded to a field. But, the field cannot have the above non-denotable type, so its type is demoted to `List`. When the field is read when a subsequent snippet is processed, JShell tries to reconstitute the type, but a type with an intersection type as a type argument cannot be parsed by the parser. As a consequence, continuing with the example above: > > jshell> List l = v; > | Error: > | incompatible types: java.util.List cannot be converted to java.util.List > | List l = v; > | ^ > > > The proposed solution here is to enhance the parser used by JShell so that it can parse intersection types at any position. JShell then can reconstitute the type, and the above snippets work: > > jshell> var v = List.of("", 0); > v ==> [, 0] > > jshell> List l = v; > l ==> [, 0] This pull request has now been integrated. Changeset: 57a65fe4 Author: Jan Lahoda URL: https://git.openjdk.org/jdk/commit/57a65fe436a3617d64bbf0b02d4c7f7c2551448f Stats: 121 lines in 3 files changed: 87 ins; 11 del; 23 mod 8322003: JShell - Incorrect type inference in lists of records implementing interfaces Reviewed-by: vromero ------------- PR: https://git.openjdk.org/jdk/pull/17223 From jlahoda at openjdk.org Mon Jan 8 14:27:47 2024 From: jlahoda at openjdk.org (Jan Lahoda) Date: Mon, 8 Jan 2024 14:27:47 GMT Subject: [jdk22] RFR: 8322003: JShell - Incorrect type inference in lists of records implementing interfaces Message-ID: Hi all, This pull request contains a backport of commit [57a65fe4](https://github.com/openjdk/jdk/commit/57a65fe436a3617d64bbf0b02d4c7f7c2551448f) from the [openjdk/jdk](https://git.openjdk.org/jdk) repository. The commit being backported was authored by Jan Lahoda on 8 Jan 2024 and was reviewed by Vicente Romero. Thanks! ------------- Commit messages: - Backport 57a65fe436a3617d64bbf0b02d4c7f7c2551448f Changes: https://git.openjdk.org/jdk22/pull/40/files Webrev: https://webrevs.openjdk.org/?repo=jdk22&pr=40&range=00 Issue: https://bugs.openjdk.org/browse/JDK-8322003 Stats: 121 lines in 3 files changed: 87 ins; 11 del; 23 mod Patch: https://git.openjdk.org/jdk22/pull/40.diff Fetch: git fetch https://git.openjdk.org/jdk22.git pull/40/head:pull/40 PR: https://git.openjdk.org/jdk22/pull/40 From wmdietl at openjdk.org Mon Jan 8 17:01:26 2024 From: wmdietl at openjdk.org (Werner Dietl) Date: Mon, 8 Jan 2024 17:01:26 GMT Subject: RFR: 8043226: Better diagnostics for non-applicable type annotations In-Reply-To: References: Message-ID: On Fri, 10 Nov 2023 01:21:28 GMT, Liam Miller-Cushon wrote: > Hi, > > Please consider this improvement to diagnostics on inadmissable type annotations. > > [JDK-8057683: clarify error messages trying to annotate scoping](https://bugs.openjdk.org/browse/JDK-8057683) is closely related to JDK-8043226 and I think could be made a duplicate of that bug. [JDK-8057683: improve ordering of errors with type annotations](https://bugs.openjdk.org/browse/JDK-8057683) is also closely related, and this PR partially fixes the issues described in that bug. > > I have some notes on details of the proposed changes below. > > --- > > Currently javac reports 'scoping construct cannot be annotated' diagnostics for type annotations at locations where they are not admissable. > > As discussed in [JDK-8043226](https://bugs.openjdk.org/browse/JDK-8043226) and [JDK-8057683](https://bugs.openjdk.org/browse/JDK-8057683), the current language is unclear. The 'scoping construct' language was used in JSR-308 discussions but didn't end up in the final specification, JLS ?9.7.4 talks about where annotations are 'admissable', and that language is mirrored in JVMS ?4.7.20.2. > > This change updates the diagnostics to state that type annotations 'not admissible at this location' and removed the reference to 'scoping constructs'. Additionally, the diagnostic now includes an explanation of a location in the type where annotations would be admissible, to make it easier to understand how to annotate qualified type names. > > Before: > > > test/langtools/tools/javac/annotations/typeAnnotations/failures/CantAnnotateScoping.java:38: error: scoping construct cannot be annotated with type-use annotation: @TA > @TA Outer.SInner osi; > ^ > > > After: > > > test/langtools/tools/javac/annotations/typeAnnotations/failures/CantAnnotateScoping.java:38: error: type annotations are not admissible at this location: @TA > @TA Outer.SInner osi; > ^ > (to annotate a qualified type, write Outer. at TA SInner) > > > --- > > Attribution currently assumes `@TA java.lang.Object` in `List<@TA java.lang.Object>` will be a type (not a package), and reports a resolution failure when it can't find a class named `java`. > > This change modifies attribution to search for packages as well as types when resolving annotated types, and relies on the subsequent error checking for annotated types to report that type annotations are not admissible at that location. > > This also improves the ordering of the diagnostic in the output, since attribution errors are report before type annotation validation errors in the l... Thanks for working on this! Improving the compiler error messages is a very important task. I'm not a reviewer, so just some comments from going through the code (I didn't compile and run it yet). src/jdk.compiler/share/classes/com/sun/tools/javac/comp/Attr.java line 5274: > 5272: attribTree(tree.underlyingType, env, new ResultInfo(KindSelector.TYP_PCK, Type.noType)); > 5273: if (underlyingType.hasTag(PACKAGE)) { > 5274: // Type annotations are not admissible on packages, but we handle packages here to be to Suggestion: // Type annotations are not admissible on packages, but we handle packages here to src/jdk.compiler/share/classes/com/sun/tools/javac/resources/compiler.properties line 3233: > 3231: # 0: fragment, 1: symbol, 2: type > 3232: compiler.err.type.annotation.inadmissible=\ > 3233: type annotations are not admissible at this location: {0}\n\ Suggestion: compiler.err.type.annotation.not.applicable=\ type annotations are not applicable at this location: {0}\n\ I don't know whether there are concrete guidelines for this or whether "admissible" is what the JLS uses for this. Looking at other annotation-related error messages in this file, most use "applicable" and "not applicable" (one key uses `inapplicable`, but the message still uses `not applicable`). There are no other uses of `admissible` in this file. There is also `annotation.not.valid.for.type` which uses `annotation not valid for an element of type {0}`, which could be another option. Also, not not sure whether it would be `are not applicable *at* this location`, `are not applicable *on* this location`, or something else. test/langtools/tools/javac/annotations/typeAnnotations/failures/CantAnnotatePackages.out line 1: > 1: CantAnnotatePackages.java:14:18: compiler.err.type.annotation.inadmissible: (compiler.misc.type.annotation.1: @TA), java.lang, @TA java.lang.Object In this output, isn't `java.lang` the `1: symbol` and `@TA java.lang.Object` the `2: type` in the error message? Won't the `to annotate a qualified type, write {1}.{2}` then output `java.lang. at TA java.lang.Object`, which isn't what we would want. Am I parsing this incorrectly? ------------- PR Review: https://git.openjdk.org/jdk/pull/16592#pullrequestreview-1809460770 PR Review Comment: https://git.openjdk.org/jdk/pull/16592#discussion_r1444890016 PR Review Comment: https://git.openjdk.org/jdk/pull/16592#discussion_r1444978083 PR Review Comment: https://git.openjdk.org/jdk/pull/16592#discussion_r1445001491 From cushon at openjdk.org Mon Jan 8 19:12:34 2024 From: cushon at openjdk.org (Liam Miller-Cushon) Date: Mon, 8 Jan 2024 19:12:34 GMT Subject: RFR: 8043226: Better diagnostics for non-applicable type annotations [v2] In-Reply-To: References: Message-ID: <4ymqDKx7z9VqfAjr93Dx7tVCUnJDoz_1TIY4oarSkoc=.26f92336-85b6-4549-a4a1-cb1d5a424d78@github.com> > Hi, > > Please consider this improvement to diagnostics on inadmissable type annotations. > > [JDK-8057683: clarify error messages trying to annotate scoping](https://bugs.openjdk.org/browse/JDK-8057683) is closely related to JDK-8043226 and I think could be made a duplicate of that bug. [JDK-8057683: improve ordering of errors with type annotations](https://bugs.openjdk.org/browse/JDK-8057683) is also closely related, and this PR partially fixes the issues described in that bug. > > I have some notes on details of the proposed changes below. > > --- > > Currently javac reports 'scoping construct cannot be annotated' diagnostics for type annotations at locations where they are not admissable. > > As discussed in [JDK-8043226](https://bugs.openjdk.org/browse/JDK-8043226) and [JDK-8057683](https://bugs.openjdk.org/browse/JDK-8057683), the current language is unclear. The 'scoping construct' language was used in JSR-308 discussions but didn't end up in the final specification, JLS ?9.7.4 talks about where annotations are 'admissable', and that language is mirrored in JVMS ?4.7.20.2. > > This change updates the diagnostics to state that type annotations 'not admissible at this location' and removed the reference to 'scoping constructs'. Additionally, the diagnostic now includes an explanation of a location in the type where annotations would be admissible, to make it easier to understand how to annotate qualified type names. > > Before: > > > test/langtools/tools/javac/annotations/typeAnnotations/failures/CantAnnotateScoping.java:38: error: scoping construct cannot be annotated with type-use annotation: @TA > @TA Outer.SInner osi; > ^ > > > After: > > > test/langtools/tools/javac/annotations/typeAnnotations/failures/CantAnnotateScoping.java:38: error: type annotations are not admissible at this location: @TA > @TA Outer.SInner osi; > ^ > (to annotate a qualified type, write Outer. at TA SInner) > > > --- > > Attribution currently assumes `@TA java.lang.Object` in `List<@TA java.lang.Object>` will be a type (not a package), and reports a resolution failure when it can't find a class named `java`. > > This change modifies attribution to search for packages as well as types when resolving annotated types, and relies on the subsequent error checking for annotated types to report that type annotations are not admissible at that location. > > This also improves the ordering of the diagnostic in the output, since attribution errors are report before type annotation validation errors in the l... Liam Miller-Cushon has updated the pull request incrementally with one additional commit since the last revision: Update src/jdk.compiler/share/classes/com/sun/tools/javac/comp/Attr.java Co-authored-by: Werner Dietl ------------- Changes: - all: https://git.openjdk.org/jdk/pull/16592/files - new: https://git.openjdk.org/jdk/pull/16592/files/55c15c9b..568eb387 Webrevs: - full: https://webrevs.openjdk.org/?repo=jdk&pr=16592&range=01 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=16592&range=00-01 Stats: 1 line in 1 file changed: 0 ins; 0 del; 1 mod Patch: https://git.openjdk.org/jdk/pull/16592.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/16592/head:pull/16592 PR: https://git.openjdk.org/jdk/pull/16592 From cushon at openjdk.org Mon Jan 8 19:20:24 2024 From: cushon at openjdk.org (Liam Miller-Cushon) Date: Mon, 8 Jan 2024 19:20:24 GMT Subject: RFR: 8043226: Better diagnostics for non-applicable type annotations [v2] In-Reply-To: References: Message-ID: On Mon, 8 Jan 2024 16:36:44 GMT, Werner Dietl wrote: >> Liam Miller-Cushon has updated the pull request incrementally with one additional commit since the last revision: >> >> Update src/jdk.compiler/share/classes/com/sun/tools/javac/comp/Attr.java >> >> Co-authored-by: Werner Dietl > > src/jdk.compiler/share/classes/com/sun/tools/javac/resources/compiler.properties line 3233: > >> 3231: # 0: fragment, 1: symbol, 2: type >> 3232: compiler.err.type.annotation.inadmissible=\ >> 3233: type annotations are not admissible at this location: {0}\n\ > > Suggestion: > > compiler.err.type.annotation.not.applicable=\ > type annotations are not applicable at this location: {0}\n\ > > > I don't know whether there are concrete guidelines for this or whether "admissible" is what the JLS uses for this. > Looking at other annotation-related error messages in this file, most use "applicable" and "not applicable" (one key uses `inapplicable`, but the message still uses `not applicable`). > There are no other uses of `admissible` in this file. > There is also `annotation.not.valid.for.type` which uses `annotation not valid for an element of type {0}`, which could be another option. > > Also, not not sure whether it would be `are not applicable *at* this location`, `are not applicable *on* this location`, or something else. Thanks, I'm very open to changing the language here. I was using 'admissible' because it is used in [JVMS 4.7.20](https://docs.oracle.com/javase/specs/jvms/se21/html/jvms-4.html#jvms-4.7.20) and [JLS 9.7.4](https://docs.oracle.com/javase/specs/jls/se21/html/jls-9.html#jls-9.7.4) to describe where type annotations are allowed on nested types. > test/langtools/tools/javac/annotations/typeAnnotations/failures/CantAnnotatePackages.out line 1: > >> 1: CantAnnotatePackages.java:14:18: compiler.err.type.annotation.inadmissible: (compiler.misc.type.annotation.1: @TA), java.lang, @TA java.lang.Object > > In this output, isn't `java.lang` the `1: symbol` and `@TA java.lang.Object` the `2: type` in the error message? > Won't the `to annotate a qualified type, write {1}.{2}` then output `java.lang. at TA java.lang.Object`, which isn't what we would want. > Am I parsing this incorrectly? I think you're parsing the arguments correctly, but when the arguments are formatted for the output the type is printed using its simple name, so we end up with: test/langtools/tools/javac/annotations/typeAnnotations/failures/CantAnnotatePackages.java:14: error: type annotations are not admissible at this location: @TA @TA java.lang.Object of1; ^ (to annotate a qualified type, write java.lang. at TA Object) ``` ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/16592#discussion_r1445204346 PR Review Comment: https://git.openjdk.org/jdk/pull/16592#discussion_r1445221432 From jjg at openjdk.org Mon Jan 8 21:26:50 2024 From: jjg at openjdk.org (Jonathan Gibbons) Date: Mon, 8 Jan 2024 21:26:50 GMT Subject: RFR: JDK-8298405: Support Markdown in Documentation Comments [v6] In-Reply-To: References: Message-ID: <0mlIFIZ2ec8oE2zlmKxoMwp59dBgOdUQs-vzTLnU7hI=.15fa2827-8c87-415b-ab74-0e42b45a5cf7@github.com> > Please review a patch to add support for Markdown syntax in documentation comments, as described in the associated JEP. > > Notable features: > > * support for `///` documentation comments in `JavaTokenizer` > * new module `jdk.internal.md` -- a private copy of the `commonmark-java` library > * updates to `DocCommentParser` to treat `///` comments as Markdown > * updates to the standard doclet to render Markdown comments in HTML Jonathan Gibbons 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 seven additional commits since the last revision: - Merge with upstream/master - Merge remote-tracking branch 'upstream/master' into 8298405.doclet-markdown-v3 - Address review comments - Fix whitespace - Improve handling of embedded inline taglets - Customize support for Markdown headings - JDK-8298405: Support Markdown in Documentation Comments ------------- Changes: - all: https://git.openjdk.org/jdk/pull/16388/files - new: https://git.openjdk.org/jdk/pull/16388/files/39cdd2bb..50bb105d Webrevs: - full: https://webrevs.openjdk.org/?repo=jdk&pr=16388&range=05 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=16388&range=04-05 Stats: 837199 lines in 5369 files changed: 205028 ins; 545552 del; 86619 mod Patch: https://git.openjdk.org/jdk/pull/16388.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/16388/head:pull/16388 PR: https://git.openjdk.org/jdk/pull/16388 From ayang at openjdk.org Tue Jan 9 06:15:22 2024 From: ayang at openjdk.org (Albert Mingkun Yang) Date: Tue, 9 Jan 2024 06:15:22 GMT Subject: RFR: 8322330: JavadocHelperTest.java OOMEs with Parallel GC and ZGC In-Reply-To: References: Message-ID: On Mon, 8 Jan 2024 13:23:02 GMT, Thomas Schatzl wrote: > Hi all, > > please review this small fix to increase max heap size for the test to let it pass with GenZGC and Parallel GC as well. > > The test has at least 660m of live data, so the default 768m provided by testng is too small for these collectors. > > Testing: local testing > > Hth, > Thomas Marked as reviewed by ayang (Reviewer). ------------- PR Review: https://git.openjdk.org/jdk/pull/17304#pullrequestreview-1810462707 From aboldtch at openjdk.org Tue Jan 9 07:47:21 2024 From: aboldtch at openjdk.org (Axel Boldt-Christmas) Date: Tue, 9 Jan 2024 07:47:21 GMT Subject: RFR: 8322330: JavadocHelperTest.java OOMEs with Parallel GC and ZGC In-Reply-To: References: Message-ID: On Mon, 8 Jan 2024 13:23:02 GMT, Thomas Schatzl wrote: > Hi all, > > please review this small fix to increase max heap size for the test to let it pass with GenZGC and Parallel GC as well. > > The test has at least 660m of live data, so the default 768m provided by testng is too small for these collectors. > > Testing: local testing > > Hth, > Thomas Looked at this issue earlier this week as well. This seem like the appropriate solution. ------------- Marked as reviewed by aboldtch (Reviewer). PR Review: https://git.openjdk.org/jdk/pull/17304#pullrequestreview-1810564101 From pbielicki at gmail.com Tue Jan 9 08:48:06 2024 From: pbielicki at gmail.com (Przemek Bielicki) Date: Tue, 9 Jan 2024 09:48:06 +0100 Subject: [private] Re: [External] : Re: [Bug] javac gives non-deterministic output (for sealed interface with records) In-Reply-To: References: <2e0d46a5-add6-4c98-b359-f8a4a4a6f1e2@oracle.com> <32306a3d-1376-4ec8-850b-f78eae103f1f@oracle.com> <8c26af0d-b0c5-410f-8db7-96e209707c90@oracle.com> Message-ID: Hey Vicente, My fellow Gradle JVM Platform engineer (Octavia Togami) created a reproducer: https://github.com/octylFractal/javac-permitted-ordering-bug Her first analysis was: "Looking at the stacktraces, it appears that when it's ordered properly, the subclasses of the sealed type are visited as part of their parent; but when it's ordered incorrectly, they're visited as part of resolving the type of a variable somewhere else." Eventually she says: "This is not in any way a Gradle bug. It has to do with ordering of other files that use the sealed type and its subclasses." Can you please verify this on your end and update the JIRA ticket with the latest findings? Thanks, Przemek -------------- next part -------------- An HTML attachment was scrubbed... URL: From tschatzl at openjdk.org Tue Jan 9 13:41:24 2024 From: tschatzl at openjdk.org (Thomas Schatzl) Date: Tue, 9 Jan 2024 13:41:24 GMT Subject: RFR: 8322330: JavadocHelperTest.java OOMEs with Parallel GC and ZGC In-Reply-To: References: Message-ID: On Tue, 9 Jan 2024 07:44:50 GMT, Axel Boldt-Christmas wrote: >> Hi all, >> >> please review this small fix to increase max heap size for the test to let it pass with GenZGC and Parallel GC as well. >> >> The test has at least 660m of live data, so the default 768m provided by testng is too small for these collectors. >> >> Testing: local testing >> >> Hth, >> Thomas > > Looked at this issue earlier this week as well. This seem like the appropriate solution. Thanks @xmas92 @albertnetymk for your reviews ------------- PR Comment: https://git.openjdk.org/jdk/pull/17304#issuecomment-1883067543 From tschatzl at openjdk.org Tue Jan 9 13:51:36 2024 From: tschatzl at openjdk.org (Thomas Schatzl) Date: Tue, 9 Jan 2024 13:51:36 GMT Subject: Integrated: 8322330: JavadocHelperTest.java OOMEs with Parallel GC and ZGC In-Reply-To: References: Message-ID: On Mon, 8 Jan 2024 13:23:02 GMT, Thomas Schatzl wrote: > Hi all, > > please review this small fix to increase max heap size for the test to let it pass with GenZGC and Parallel GC as well. > > The test has at least 660m of live data, so the default 768m provided by testng is too small for these collectors. > > Testing: local testing > > Hth, > Thomas This pull request has now been integrated. Changeset: 52c7ff1d Author: Thomas Schatzl URL: https://git.openjdk.org/jdk/commit/52c7ff1d81940d6d0d1e3dd7ad0447c80708161c Stats: 1 line in 1 file changed: 0 ins; 0 del; 1 mod 8322330: JavadocHelperTest.java OOMEs with Parallel GC and ZGC Reviewed-by: ayang, aboldtch ------------- PR: https://git.openjdk.org/jdk/pull/17304 From prappo at openjdk.org Tue Jan 9 14:35:33 2024 From: prappo at openjdk.org (Pavel Rappo) Date: Tue, 9 Jan 2024 14:35:33 GMT Subject: RFR: 8322330: JavadocHelperTest.java OOMEs with Parallel GC and ZGC In-Reply-To: References: Message-ID: On Mon, 8 Jan 2024 13:23:02 GMT, Thomas Schatzl wrote: > Hi all, > > please review this small fix to increase max heap size for the test to let it pass with GenZGC and Parallel GC as well. > > The test has at least 660m of live data, so the default 768m provided by testng is too small for these collectors. > > Testing: local testing > > Hth, > Thomas I have a few questions on this PR. Firstly, general: how come this PR hasn't been reviewed by jshell people? I appreciate that the change is about GCs, but generally a PR should be reviewed by experts in all areas that that PR touches. Secondly, is that correct that the Skara bot [applied] the "javadoc" label but not "kulla" to a test that belongs to jshell? (CC'ing @jonathan-gibbons and @lahodaj.) To be clear, I see the respective [rules] in place, but I wonder if they are correct. [applied]: https://github.com/openjdk/jdk/pull/17304#issuecomment-1881003029 [rules]: https://github.com/openjdk/skara/blob/ef8238c35070094e979a13ad872d105f883f3881/config/mailinglist/rules/jdk.json#L457-L474 ------------- PR Comment: https://git.openjdk.org/jdk/pull/17304#issuecomment-1883157740 From vicente.romero at oracle.com Tue Jan 9 16:04:52 2024 From: vicente.romero at oracle.com (Vicente Romero) Date: Tue, 9 Jan 2024 11:04:52 -0500 Subject: [private] Re: [External] : Re: [Bug] javac gives non-deterministic output (for sealed interface with records) In-Reply-To: References: <2e0d46a5-add6-4c98-b359-f8a4a4a6f1e2@oracle.com> <32306a3d-1376-4ec8-850b-f78eae103f1f@oracle.com> <8c26af0d-b0c5-410f-8db7-96e209707c90@oracle.com> Message-ID: Hi Przemek, this is pretty good, thanks for the reproducer. I will update the bug entry, Thanks, Vicente On 1/9/24 03:48, Przemek Bielicki wrote: > Hey Vicente, > > My fellow Gradle JVM Platform engineer (Octavia Togami) created a > reproducer: > https://github.com/octylFractal/javac-permitted-ordering-bug > > Her first analysis was: "Looking at the stacktraces, it appears that > when it's ordered properly, the subclasses of the sealed type are > visited as part of their parent; but when it's ordered incorrectly, > they're visited as part of resolving the type of a variable somewhere > else." > Eventually she says: "This is not in any way a Gradle bug. It has to > do with ordering of other files that use the sealed type and its > subclasses." > > Can you please verify this on your end and update the JIRA ticket with > the latest findings? > > Thanks, > Przemek -------------- next part -------------- An HTML attachment was scrubbed... URL: From tschatzl at openjdk.org Tue Jan 9 16:14:31 2024 From: tschatzl at openjdk.org (Thomas Schatzl) Date: Tue, 9 Jan 2024 16:14:31 GMT Subject: RFR: 8322330: JavadocHelperTest.java OOMEs with Parallel GC and ZGC In-Reply-To: References: Message-ID: On Tue, 9 Jan 2024 14:32:19 GMT, Pavel Rappo wrote: > I have a few questions on this PR. Firstly, general: how come this PR hasn't been reviewed by jshell people? I appreciate that the change is about GCs, but generally a PR should be reviewed by experts in all areas that that PR touches. There are multiple reasons why I thought that it is fine to integrate without further reviews, some of them are: * This is a test change that only modifies the runtime environment of the test to allow GCs to handle the load. This has been evaluated and verified that the live data set is too large for some collectors to handle. I.e. the PR changes no jshell/javadoc or test code at all. * The problem is well understood - too much live data used by the test due to other changes. There did not seem to be a memory leak or something either while looking at the logs (I did not mention this in the description, but I checked). * The CR has also explicitly been moved to the GC team to handle (from the javadoc component). * The duplicate CR [JDK-8318025](https://bugs.openjdk.org/browse/JDK-8318025) is three months old now, with an explicit comment by experts in that area that this is likely a heap capacity issue, which the evaluation confirmed. * The risk that the fix is wrong or worsens the situation (new test failures) is minimal imho. * Formally the 24h rule so that everyone can participate has been observed. It is unfortunate that the "kulla" label has not been applied which caused some people to miss the PR (apparently this label explicitly notifies you(?) jshell experts), so apologies for missing that. However this (and the integration due to above reasons) does not mean that the discussion about the change is done with this integration, and obviously it can still be commented on, re-evaluated and changed as needed. ------------- PR Comment: https://git.openjdk.org/jdk/pull/17304#issuecomment-1883345570 From jlahoda at openjdk.org Tue Jan 9 16:18:32 2024 From: jlahoda at openjdk.org (Jan Lahoda) Date: Tue, 9 Jan 2024 16:18:32 GMT Subject: RFR: 8322330: JavadocHelperTest.java OOMEs with Parallel GC and ZGC In-Reply-To: References: Message-ID: On Mon, 8 Jan 2024 13:23:02 GMT, Thomas Schatzl wrote: > Hi all, > > please review this small fix to increase max heap size for the test to let it pass with GenZGC and Parallel GC as well. > > The test has at least 660m of live data, so the default 768m provided by testng is too small for these collectors. > > Testing: local testing > > Hth, > Thomas FWIW - I don't mind the change. I think it is more for the GC people if they are fine with some GC requiring more memory than others, or if they want to investigate further. The validity of the javadoc-related test is not affected by this, I think. ------------- PR Comment: https://git.openjdk.org/jdk/pull/17304#issuecomment-1883352387 From cpovirk at google.com Tue Jan 9 16:26:29 2024 From: cpovirk at google.com (Chris Povirk) Date: Tue, 9 Jan 2024 11:26:29 -0500 Subject: diagnostics for non-applicable type annotations In-Reply-To: References: Message-ID: Thanks, Liam. We've found the current error messages to be a source of confusion: While the average user doesn't use type-use annotations, those users who do use them seem to hit this pretty frequently. We have our own FAQ entry about it in our internal documentation, and I also refer people to the Checker Framework's documentation , which gives advice similar to that implemented by Liam's PR. I would expect for that page and this Stack Overflow answer to get more traffic as type-use annotations grow in popularity, as we're aiming for them to do as part of our work on JSpecify nullness. The error-message changes could save users a trip to those docs. -------------- next part -------------- An HTML attachment was scrubbed... URL: From tschatzl at openjdk.org Tue Jan 9 17:23:40 2024 From: tschatzl at openjdk.org (Thomas Schatzl) Date: Tue, 9 Jan 2024 17:23:40 GMT Subject: [jdk22] RFR: 8322330: JavadocHelperTest.java OOMEs with Parallel GC and ZGC Message-ID: Hi all, This pull request contains a backport of commit [52c7ff1d](https://github.com/openjdk/jdk/commit/52c7ff1d81940d6d0d1e3dd7ad0447c80708161c) from the [openjdk/jdk](https://git.openjdk.org/jdk) repository. The commit being backported was authored by Thomas Schatzl on 9 Jan 2024 and was reviewed by Albert Mingkun Yang and Axel Boldt-Christmas. This is a clean backport. Thanks! Thomas ------------- Commit messages: - Backport 52c7ff1d81940d6d0d1e3dd7ad0447c80708161c Changes: https://git.openjdk.org/jdk22/pull/44/files Webrev: https://webrevs.openjdk.org/?repo=jdk22&pr=44&range=00 Issue: https://bugs.openjdk.org/browse/JDK-8322330 Stats: 1 line in 1 file changed: 0 ins; 0 del; 1 mod Patch: https://git.openjdk.org/jdk22/pull/44.diff Fetch: git fetch https://git.openjdk.org/jdk22.git pull/44/head:pull/44 PR: https://git.openjdk.org/jdk22/pull/44 From jjg at openjdk.org Tue Jan 9 21:42:31 2024 From: jjg at openjdk.org (Jonathan Gibbons) Date: Tue, 9 Jan 2024 21:42:31 GMT Subject: RFR: 8322330: JavadocHelperTest.java OOMEs with Parallel GC and ZGC In-Reply-To: References: Message-ID: On Tue, 9 Jan 2024 16:15:29 GMT, Jan Lahoda wrote: >> Hi all, >> >> please review this small fix to increase max heap size for the test to let it pass with GenZGC and Parallel GC as well. >> >> The test has at least 660m of live data, so the default 768m provided by testng is too small for these collectors. >> >> Testing: local testing >> >> Hth, >> Thomas > > FWIW - I don't mind the change. I think it is more for the GC people if they are fine with some GC requiring more memory than others, or if they want to investigate further. The validity of the javadoc-related test is not affected by this, I think. 1. _No `kulla` label_: that's an issue that should be investigated and fixed. For my part, I saw the PR but assumed that @lahodaj would address it, as the engineer primarily responsible for the test. 2. While I read and accept @lahodaj 's comment that he is OK with the fix, in general it should _not_ be assumed that the solution to all out-of-memory errors is to provide more memory. At least in part, it should be examined to see why the test is running out of memory, even if the proximate cause is to change the GC. There is a history that I would now consider an anti-pattern of LangTools tests running on monotonically increasing data sets. I know, because I wrote some of them, back in the day. The (anti-)pattern is to run a test on all available data files, for some value of "available" which is typically "all source files (in the `src` directory) or "all test files" (such as in the `test/langtools` directory. While the practice will for-sure lead to monotonically increasing run times, we could/should make sure that it doesn't lead to monotonically increasing memory requirements. There have been (Oracle-internal) discussions about managing the "size" of tests, whether that is time-size or memory-size, and this test is another candidate for those discussions. (@jddarcy) ------------- PR Comment: https://git.openjdk.org/jdk/pull/17304#issuecomment-1883841560 From vromero at openjdk.org Tue Jan 9 22:10:23 2024 From: vromero at openjdk.org (Vicente Romero) Date: Tue, 9 Jan 2024 22:10:23 GMT Subject: RFR: 8322477: order of subclasses in the permits clause can differ between compilations In-Reply-To: References: Message-ID: On Fri, 5 Jan 2024 17:42:33 GMT, Vicente Romero wrote: > This is a very interesting issue. Given code like: > > sealed interface Sealed { > record R1() implements Sealed {} > record R2() implements Sealed {} > } > > > As we know javac will infer the `permits` clause of sealed interface `Sealed` logically the order should correspond to the order in which the permitted subclasses appear in the source code. Well it has been consistently observed by the reported of this bug, that some tools like Gradle while doing incremental compilation can make javac infer either `R1, R2` or `R2, R1` as permitted subclasses. The reason is not clear still under investigation on their side but the fact is that javac is generating inconsistent output for some classes with this shape. The proposed solution is to store the position of the permitted subclasses being discovered by javac so that the order of the permitted subclasses corresponds to the original order in the source file. Efforts to reduce the project where the issue was discovered to a small reproductor have been unsuccessful but the proposed patch have fixed the issue observed by the reporter. > > TIA at the end the swap in the permits clause order can be boiled down to symbol completions that were triggered "before" expected by a call to Symbol::flags but, even if this was the right solution it is not future-proofed as a future change can include a call to Symbol::flags that can alter the expected order of the permits clause. This is why I think that relying on the original positions in the source code as the key for sorting the elements in the permits clause is a most. For example the patch below fixes the issue with current master, but as mentioned above this is not a good solution looking forward: diff --git a/src/jdk.compiler/share/classes/com/sun/tools/javac/comp/Attr.java b/src/jdk.compiler/share/classes/com/sun/tools/javac/comp/Attr.java index 342ccb26798..9a939ef44db 100644 --- a/src/jdk.compiler/share/classes/com/sun/tools/javac/comp/Attr.java +++ b/src/jdk.compiler/share/classes/com/sun/tools/javac/comp/Attr.java @@ -4441,7 +4441,7 @@ public void visitSelect(JCFieldAccess tree) { if (isType(sitesym)) { if (sym.name != names._this && sym.name != names._super) { // Check if type-qualified fields or methods are static (JLS) - if ((sym.flags() & STATIC) == 0 && + if ((sym.flags_field & STATIC) == 0 && sym.name != names._super && (sym.kind == VAR || sym.kind == MTH)) { rs.accessBase(rs.new StaticError(sym), diff --git a/src/jdk.compiler/share/classes/com/sun/tools/javac/comp/Check.java b/src/jdk.compiler/share/classes/com/sun/tools/javac/comp/Check.java index f9b228203d4..76a71ed97dc 100644 --- a/src/jdk.compiler/share/classes/com/sun/tools/javac/comp/Check.java +++ b/src/jdk.compiler/share/classes/com/sun/tools/javac/comp/Check.java @@ -3814,7 +3814,7 @@ void checkDeprecated(Supplier pos, final Symbol other, final } void checkSunAPI(final DiagnosticPosition pos, final Symbol s) { - if ((s.flags() & PROPRIETARY) != 0) { + if ((s.flags_field & PROPRIETARY) != 0) { deferredLintHandler.report(() -> { log.mandatoryWarning(pos, Warnings.SunProprietary(s)); }); @@ -3828,8 +3828,8 @@ void checkProfile(final DiagnosticPosition pos, final Symbol s) { } void checkPreview(DiagnosticPosition pos, Symbol other, Symbol s) { - if ((s.flags() & PREVIEW_API) != 0 && !preview.participatesInPreview(syms, other, s) && !disablePreviewCheck) { - if ((s.flags() & PREVIEW_REFLECTIVE) == 0) { + if ((s.flags_field & PREVIEW_API) != 0 && !preview.participatesInPreview(syms, other, s) && !disablePreviewCheck) { + if ((s.flags_field & PREVIEW_REFLECTIVE) == 0) { if (!preview.isEnabled()) { log.error(pos, Errors.IsPreview(s)); } else { diff --git a/src/jdk.compiler/share/classes/com/sun/tools/javac/comp/Resolve.java b/src/jdk.compiler/share/classes/com/sun/tools/javac/comp/Resolve.java index 3980f03713d..f8b2614306b 100644 --- a/src/jdk.compiler/share/classes/com/sun/tools/javac/comp/Resolve.java +++ b/src/jdk.compiler/share/classes/com/sun/tools/javac/comp/Resolve.java @@ -415,7 +415,7 @@ public boolean isAccessible(Env env, Type site, Symbol sym, boolean return true; } - switch ((short)(sym.flags() & AccessFlags)) { + switch ((short)(sym.flags_field & AccessFlags)) { case PRIVATE: return (env.enclClass.sym == sym.owner // fast special case ------------- PR Comment: https://git.openjdk.org/jdk/pull/17284#issuecomment-1883876588 From vromero at openjdk.org Wed Jan 10 03:33:48 2024 From: vromero at openjdk.org (Vicente Romero) Date: Wed, 10 Jan 2024 03:33:48 GMT Subject: RFR: 8322477: order of subclasses in the permits clause can differ between compilations [v2] In-Reply-To: References: Message-ID: <-MmyJ813OIq7gT3PEQ47iv1tlm3N2Lcr_wgughcBtKQ=.9e25f8e6-d912-42fe-846d-2a8d08367e1e@github.com> > This is a very interesting issue. Given code like: > > sealed interface Sealed { > record R1() implements Sealed {} > record R2() implements Sealed {} > } > > > As we know javac will infer the `permits` clause of sealed interface `Sealed` logically the order should correspond to the order in which the permitted subclasses appear in the source code. Well it has been consistently observed by the reported of this bug, that some tools like Gradle while doing incremental compilation can make javac infer either `R1, R2` or `R2, R1` as permitted subclasses. The reason is not clear still under investigation on their side but the fact is that javac is generating inconsistent output for some classes with this shape. The proposed solution is to store the position of the permitted subclasses being discovered by javac so that the order of the permitted subclasses corresponds to the original order in the source file. Efforts to reduce the project where the issue was discovered to a small reproductor have been unsuccessful but the proposed patch have fixed the issue observed by the reporter. > > TIA Vicente Romero has updated the pull request incrementally with one additional commit since the last revision: adding regression test ------------- Changes: - all: https://git.openjdk.org/jdk/pull/17284/files - new: https://git.openjdk.org/jdk/pull/17284/files/29702777..637f4241 Webrevs: - full: https://webrevs.openjdk.org/?repo=jdk&pr=17284&range=01 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=17284&range=00-01 Stats: 32 lines in 1 file changed: 31 ins; 1 del; 0 mod Patch: https://git.openjdk.org/jdk/pull/17284.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/17284/head:pull/17284 PR: https://git.openjdk.org/jdk/pull/17284 From vromero at openjdk.org Wed Jan 10 03:48:42 2024 From: vromero at openjdk.org (Vicente Romero) Date: Wed, 10 Jan 2024 03:48:42 GMT Subject: RFR: 8322477: order of subclasses in the permits clause can differ between compilations [v3] In-Reply-To: References: Message-ID: > This is a very interesting issue. Given code like: > > sealed interface Sealed { > record R1() implements Sealed {} > record R2() implements Sealed {} > } > > > As we know javac will infer the `permits` clause of sealed interface `Sealed` logically the order should correspond to the order in which the permitted subclasses appear in the source code. Well it has been consistently observed by the reported of this bug, that some tools like Gradle while doing incremental compilation can make javac infer either `R1, R2` or `R2, R1` as permitted subclasses. The reason is not clear still under investigation on their side but the fact is that javac is generating inconsistent output for some classes with this shape. The proposed solution is to store the position of the permitted subclasses being discovered by javac so that the order of the permitted subclasses corresponds to the original order in the source file. Efforts to reduce the project where the issue was discovered to a small reproductor have been unsuccessful but the proposed patch have fixed the issue observed by the reporter. > > TIA Vicente Romero has updated the pull request incrementally with one additional commit since the last revision: updating regression test ------------- Changes: - all: https://git.openjdk.org/jdk/pull/17284/files - new: https://git.openjdk.org/jdk/pull/17284/files/637f4241..20ff11bc Webrevs: - full: https://webrevs.openjdk.org/?repo=jdk&pr=17284&range=02 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=17284&range=01-02 Stats: 18 lines in 1 file changed: 10 ins; 7 del; 1 mod Patch: https://git.openjdk.org/jdk/pull/17284.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/17284/head:pull/17284 PR: https://git.openjdk.org/jdk/pull/17284 From tschatzl at openjdk.org Wed Jan 10 09:33:33 2024 From: tschatzl at openjdk.org (Thomas Schatzl) Date: Wed, 10 Jan 2024 09:33:33 GMT Subject: RFR: 8322330: JavadocHelperTest.java OOMEs with Parallel GC and ZGC In-Reply-To: References: Message-ID: On Tue, 9 Jan 2024 16:15:29 GMT, Jan Lahoda wrote: >> Hi all, >> >> please review this small fix to increase max heap size for the test to let it pass with GenZGC and Parallel GC as well. >> >> The test has at least 660m of live data, so the default 768m provided by testng is too small for these collectors. >> >> Testing: local testing >> >> Hth, >> Thomas > > FWIW - I don't mind the change. I think it is more for the GC people if they are fine with some GC requiring more memory than others, or if they want to investigate further. The validity of the javadoc-related test is not affected by this, I think. >From @lahodaj: > FWIW - I don't mind the change. I think it is more for the GC people if they are fine with some GC requiring more memory than others, or if they want to investigate further. For garbage collection algorithms it is no different to other memory management algorithms to require different amount of slack to operate efficiently or at all. A very, very old rule of thumb mentions like 30% of total heap capacity should be live set size for optimal operation (there can be huge variances depending on allocation rate and absolute heap capacity). This is a bit low imho, but at 85%+ (>660/768M) there is a large risk that one or the other algorithm just bails out. (To be clear, e.g. Parallel GC and GenZGC can probably be configured to require less, but that would make the change unnecessarily tied to it). >The validity of the javadoc-related test is not affected by this, I think. No. >From @jonathan-gibbons : > There is a history that I would now consider an anti-pattern of LangTools tests running on monotonically increasing data sets. [...] While the practice will for-sure lead to monotonically increasing run times, we could/should make sure that it doesn't lead to monotonically increasing memory requirements. There is also the possibility that this test has never been run with anything but the default collector before (and/or the problem with other collectors never been reported previously), that is, G1, which has very little minimum intrinsic requirements to limp along (jshell has been introduced in java 9, which is incidentally the version when G1 got to be the default collector). The test file has been introduced in 9, but parts of the test only later. The test also seems to access src.zip ("all java files") which is not fixed, but not sure if it ever e.g. builds a javadoc model of the whole sources in memory. I think not afaict after a very brief look. ------------- PR Comment: https://git.openjdk.org/jdk/pull/17304#issuecomment-1884485705 From jlahoda at openjdk.org Wed Jan 10 16:36:24 2024 From: jlahoda at openjdk.org (Jan Lahoda) Date: Wed, 10 Jan 2024 16:36:24 GMT Subject: RFR: 8322477: order of subclasses in the permits clause can differ between compilations [v3] In-Reply-To: References: Message-ID: On Wed, 10 Jan 2024 03:48:42 GMT, Vicente Romero wrote: >> This is a very interesting issue. Given code like: >> >> sealed interface Sealed { >> record R1() implements Sealed {} >> record R2() implements Sealed {} >> } >> >> >> As we know javac will infer the `permits` clause of sealed interface `Sealed` logically the order should correspond to the order in which the permitted subclasses appear in the source code. Well it has been consistently observed by the reported of this bug, that some tools like Gradle while doing incremental compilation can make javac infer either `R1, R2` or `R2, R1` as permitted subclasses. The reason is not clear still under investigation on their side but the fact is that javac is generating inconsistent output for some classes with this shape. The proposed solution is to store the position of the permitted subclasses being discovered by javac so that the order of the permitted subclasses corresponds to the original order in the source file. Efforts to reduce the project where the issue was discovered to a small reproductor have been unsuccessful but the proposed patch have fixed the issue observed by the reporter. >> >> TIA > > Vicente Romero has updated the pull request incrementally with one additional commit since the last revision: > > updating regression test While it might be nicer to have the order implied, I can see that's not really easy to achieve in case of arbitrary order of completion. So, this looks OK to me. One suggestion for consideration slightly simplify the code. No re-review needed if the suggestion is accepted. src/jdk.compiler/share/classes/com/sun/tools/javac/code/Symbol.java line 1334: > 1332: > 1333: public void addPermittedSubclass(ClassSymbol csym, int pos) { > 1334: if (isPermittedExplicit) { If I understand it properly, the codepaths to add implicitly and explicitly declared permitted subclasses are completely different. And when the permitted subclasses are explicit, the `addPermittedSubclass` won't be called. For consideration: just using `Assert.check(!isPermittedExplicit)`, drop the if. ------------- Marked as reviewed by jlahoda (Reviewer). PR Review: https://git.openjdk.org/jdk/pull/17284#pullrequestreview-1813636466 PR Review Comment: https://git.openjdk.org/jdk/pull/17284#discussion_r1447632286 From prappo at openjdk.org Wed Jan 10 16:58:35 2024 From: prappo at openjdk.org (Pavel Rappo) Date: Wed, 10 Jan 2024 16:58:35 GMT Subject: RFR: JDK-8298405: Support Markdown in Documentation Comments [v6] In-Reply-To: References: Message-ID: On Wed, 8 Nov 2023 15:57:14 GMT, Pavel Rappo wrote: >> Jonathan Gibbons 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 seven additional commits since the last revision: >> >> - Merge with upstream/master >> - Merge remote-tracking branch 'upstream/master' into 8298405.doclet-markdown-v3 >> - Address review comments >> - Fix whitespace >> - Improve handling of embedded inline taglets >> - Customize support for Markdown headings >> - JDK-8298405: Support Markdown in Documentation Comments > > test/langtools/tools/javac/doctree/DocCommentTester.java line 1012: > >> 1010: // } >> 1011: // return null; >> 1012: // } > > Debugging leftover? If you want to leave it for debugging you can make it private and uncomment. > test/langtools/tools/javac/doctree/MarkdownTest.java line 555: > >> 553: // block tags: empty >> 554: //] >> 555: //*/ > > Just to clarify: it is supposed to be commented out, right? If uncommented, this test fails with a slightly different error. Please update the DocComment printout in that commented out test: the actual content is different. It would be nice if the test were passing at least at the moment of its initial commit. Here's what I see locally: Expect: DocComment[DOC_COMMENT, pos:0 firstSentence: 1 Summary[SUMMARY, pos:4 summary: 1 Erroneous[ERRONEOUS, pos:14, prefPos:37 code: compiler.err.dc.unterminated.inline.tag body: abc_`|_def}|_rest_`more` ] ] body: empty block tags: empty ] Found: DocComment[DOC_COMMENT, pos:0 firstSentence: 1 Summary[SUMMARY, pos:1 summary: 1 Erroneous[ERRONEOUS, pos:11, prefPos:32 code: compiler.err.dc.unterminated.inline.tag body: abc_`|def}|rest_`more` ] ] body: empty block tags: empty ] ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/16388#discussion_r1447662029 PR Review Comment: https://git.openjdk.org/jdk/pull/16388#discussion_r1447659363 From wxiao at openjdk.org Wed Jan 10 17:07:31 2024 From: wxiao at openjdk.org (Weibing Xiao) Date: Wed, 10 Jan 2024 17:07:31 GMT Subject: [jdk22] RFR: 8318971: Better Error Handling for Jar Tool When Processing Non-existent Files Message-ID: <-LODLKFRtovbU3hGJ__1m-GeaP-BDWxtZTUXqIzQ0EQ=.e9469bce-b68d-42d7-adc6-6490603b2548@github.com> Better Error Handling for Jar Tool When Processing Non-existent Files.
It is a clean backport. ------------- Commit messages: - Backport 8ae309ebacd6947bbad2ef168ca13702e1cba099 Changes: https://git.openjdk.org/jdk22/pull/55/files Webrev: https://webrevs.openjdk.org/?repo=jdk22&pr=55&range=00 Issue: https://bugs.openjdk.org/browse/JDK-8318971 Stats: 86 lines in 2 files changed: 84 ins; 0 del; 2 mod Patch: https://git.openjdk.org/jdk22/pull/55.diff Fetch: git fetch https://git.openjdk.org/jdk22.git pull/55/head:pull/55 PR: https://git.openjdk.org/jdk22/pull/55 From vromero at openjdk.org Wed Jan 10 17:27:39 2024 From: vromero at openjdk.org (Vicente Romero) Date: Wed, 10 Jan 2024 17:27:39 GMT Subject: RFR: 8322477: order of subclasses in the permits clause can differ between compilations [v4] In-Reply-To: References: Message-ID: > This is a very interesting issue. Given code like: > > sealed interface Sealed { > record R1() implements Sealed {} > record R2() implements Sealed {} > } > > > As we know javac will infer the `permits` clause of sealed interface `Sealed` logically the order should correspond to the order in which the permitted subclasses appear in the source code. Well it has been consistently observed by the reported of this bug, that some tools like Gradle while doing incremental compilation can make javac infer either `R1, R2` or `R2, R1` as permitted subclasses. The reason is not clear still under investigation on their side but the fact is that javac is generating inconsistent output for some classes with this shape. The proposed solution is to store the position of the permitted subclasses being discovered by javac so that the order of the permitted subclasses corresponds to the original order in the source file. Efforts to reduce the project where the issue was discovered to a small reproductor have been unsuccessful but the proposed patch have fixed the issue observed by the reporter. > > TIA Vicente Romero has updated the pull request incrementally with one additional commit since the last revision: addressing review comments ------------- Changes: - all: https://git.openjdk.org/jdk/pull/17284/files - new: https://git.openjdk.org/jdk/pull/17284/files/20ff11bc..b9703e8c Webrevs: - full: https://webrevs.openjdk.org/?repo=jdk&pr=17284&range=03 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=17284&range=02-03 Stats: 12 lines in 1 file changed: 1 ins; 5 del; 6 mod Patch: https://git.openjdk.org/jdk/pull/17284.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/17284/head:pull/17284 PR: https://git.openjdk.org/jdk/pull/17284 From vromero at openjdk.org Wed Jan 10 17:27:43 2024 From: vromero at openjdk.org (Vicente Romero) Date: Wed, 10 Jan 2024 17:27:43 GMT Subject: RFR: 8322477: order of subclasses in the permits clause can differ between compilations [v3] In-Reply-To: References: Message-ID: <4ybO9uUr9qItqIZBihetOcFCkfOjAf3oKhw9m4qUNfs=.5d860245-a78a-4bc3-81e1-05e48a826146@github.com> On Wed, 10 Jan 2024 16:32:10 GMT, Jan Lahoda wrote: >> Vicente Romero has updated the pull request incrementally with one additional commit since the last revision: >> >> updating regression test > > src/jdk.compiler/share/classes/com/sun/tools/javac/code/Symbol.java line 1334: > >> 1332: >> 1333: public void addPermittedSubclass(ClassSymbol csym, int pos) { >> 1334: if (isPermittedExplicit) { > > If I understand it properly, the codepaths to add implicitly and explicitly declared permitted subclasses are completely different. And when the permitted subclasses are explicit, the `addPermittedSubclass` won't be called. > > For consideration: just using `Assert.check(!isPermittedExplicit)`, drop the if. sure will do, thanks ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/17284#discussion_r1447693614 From liach at openjdk.org Wed Jan 10 17:35:22 2024 From: liach at openjdk.org (Chen Liang) Date: Wed, 10 Jan 2024 17:35:22 GMT Subject: RFR: 8322477: order of subclasses in the permits clause can differ between compilations [v4] In-Reply-To: References: Message-ID: On Wed, 10 Jan 2024 17:27:39 GMT, Vicente Romero wrote: >> This is a very interesting issue. Given code like: >> >> sealed interface Sealed { >> record R1() implements Sealed {} >> record R2() implements Sealed {} >> } >> >> >> As we know javac will infer the `permits` clause of sealed interface `Sealed` logically the order should correspond to the order in which the permitted subclasses appear in the source code. Well it has been consistently observed by the reported of this bug, that some tools like Gradle while doing incremental compilation can make javac infer either `R1, R2` or `R2, R1` as permitted subclasses. The reason is not clear still under investigation on their side but the fact is that javac is generating inconsistent output for some classes with this shape. The proposed solution is to store the position of the permitted subclasses being discovered by javac so that the order of the permitted subclasses corresponds to the original order in the source file. Efforts to reduce the project where the issue was discovered to a small reproductor have been unsuccessful but the proposed patch have fixed the issue observed by the reporter. >> >> TIA > > Vicente Romero has updated the pull request incrementally with one additional commit since the last revision: > > addressing review comments src/jdk.compiler/share/classes/com/sun/tools/javac/code/Symbol.java line 1360: > 1358: permitted.clear(); > 1359: for (Symbol csym : permittedSubs) { > 1360: permitted.add(new PermittedClassWithPos(csym, 0)); If we have multiple `0` positions in the list, a future `addPermittedSubclass` call may not produce a deterministic list if it's called with pos `0`, as that's how `Arrays.binarySearch` behaves. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/17284#discussion_r1447712012 From wxiao at openjdk.org Wed Jan 10 17:48:30 2024 From: wxiao at openjdk.org (Weibing Xiao) Date: Wed, 10 Jan 2024 17:48:30 GMT Subject: [jdk22] RFR: 8318971: Better Error Handling for Jar Tool When Processing Non-existent Files Message-ID: Better Error Handling for Jar Tool When Processing Non-existent Files.
It needs to be backported to JDK22. ------------- Commit messages: - Backport 8ae309ebacd6947bbad2ef168ca13702e1cba099 Changes: https://git.openjdk.org/jdk22/pull/56/files Webrev: https://webrevs.openjdk.org/?repo=jdk22&pr=56&range=00 Issue: https://bugs.openjdk.org/browse/JDK-8318971 Stats: 86 lines in 2 files changed: 84 ins; 0 del; 2 mod Patch: https://git.openjdk.org/jdk22/pull/56.diff Fetch: git fetch https://git.openjdk.org/jdk22.git pull/56/head:pull/56 PR: https://git.openjdk.org/jdk22/pull/56 From wxiao at openjdk.org Wed Jan 10 17:49:26 2024 From: wxiao at openjdk.org (Weibing Xiao) Date: Wed, 10 Jan 2024 17:49:26 GMT Subject: [jdk22] Withdrawn: 8318971: Better Error Handling for Jar Tool When Processing Non-existent Files In-Reply-To: <-LODLKFRtovbU3hGJ__1m-GeaP-BDWxtZTUXqIzQ0EQ=.e9469bce-b68d-42d7-adc6-6490603b2548@github.com> References: <-LODLKFRtovbU3hGJ__1m-GeaP-BDWxtZTUXqIzQ0EQ=.e9469bce-b68d-42d7-adc6-6490603b2548@github.com> Message-ID: On Wed, 10 Jan 2024 17:02:03 GMT, Weibing Xiao wrote: > Better Error Handling for Jar Tool When Processing Non-existent Files.
> It is a clean backport. This pull request has been closed without being integrated. ------------- PR: https://git.openjdk.org/jdk22/pull/55 From wxiao at openjdk.org Wed Jan 10 17:49:25 2024 From: wxiao at openjdk.org (Weibing Xiao) Date: Wed, 10 Jan 2024 17:49:25 GMT Subject: [jdk22] RFR: 8318971: Better Error Handling for Jar Tool When Processing Non-existent Files In-Reply-To: <-LODLKFRtovbU3hGJ__1m-GeaP-BDWxtZTUXqIzQ0EQ=.e9469bce-b68d-42d7-adc6-6490603b2548@github.com> References: <-LODLKFRtovbU3hGJ__1m-GeaP-BDWxtZTUXqIzQ0EQ=.e9469bce-b68d-42d7-adc6-6490603b2548@github.com> Message-ID: On Wed, 10 Jan 2024 17:02:03 GMT, Weibing Xiao wrote: > Better Error Handling for Jar Tool When Processing Non-existent Files.
> It is a clean backport. Use this PR instead https://github.com/openjdk/jdk22/pull/56. ------------- PR Comment: https://git.openjdk.org/jdk22/pull/55#issuecomment-1885333004 From vromero at openjdk.org Wed Jan 10 17:55:31 2024 From: vromero at openjdk.org (Vicente Romero) Date: Wed, 10 Jan 2024 17:55:31 GMT Subject: RFR: 8322477: order of subclasses in the permits clause can differ between compilations [v4] In-Reply-To: References: Message-ID: On Wed, 10 Jan 2024 17:32:17 GMT, Chen Liang wrote: >> Vicente Romero has updated the pull request incrementally with one additional commit since the last revision: >> >> addressing review comments > > src/jdk.compiler/share/classes/com/sun/tools/javac/code/Symbol.java line 1360: > >> 1358: permitted.clear(); >> 1359: for (Symbol csym : permittedSubs) { >> 1360: permitted.add(new PermittedClassWithPos(csym, 0)); > > If we have multiple `0` positions in the list, a future `addPermittedSubclass` call may not produce a deterministic list if it's called with pos `0`, as that's how `Arrays.binarySearch` behaves. right but as Jan mentioned we will be calling either `addPermittedSubclass` or `setPermittedSubclasses` not both. We need to set a default position value if none is provided, `0` is a good option or `-1` ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/17284#discussion_r1447730402 From vromero at openjdk.org Wed Jan 10 17:55:33 2024 From: vromero at openjdk.org (Vicente Romero) Date: Wed, 10 Jan 2024 17:55:33 GMT Subject: Integrated: 8322477: order of subclasses in the permits clause can differ between compilations In-Reply-To: References: Message-ID: On Fri, 5 Jan 2024 17:42:33 GMT, Vicente Romero wrote: > This is a very interesting issue. Given code like: > > sealed interface Sealed { > record R1() implements Sealed {} > record R2() implements Sealed {} > } > > > As we know javac will infer the `permits` clause of sealed interface `Sealed` logically the order should correspond to the order in which the permitted subclasses appear in the source code. Well it has been consistently observed by the reported of this bug, that some tools like Gradle while doing incremental compilation can make javac infer either `R1, R2` or `R2, R1` as permitted subclasses. The reason is not clear still under investigation on their side but the fact is that javac is generating inconsistent output for some classes with this shape. The proposed solution is to store the position of the permitted subclasses being discovered by javac so that the order of the permitted subclasses corresponds to the original order in the source file. Efforts to reduce the project where the issue was discovered to a small reproductor have been unsuccessful but the proposed patch have fixed the issue observed by the reporter. > > TIA This pull request has now been integrated. Changeset: 5ba69e17 Author: Vicente Romero URL: https://git.openjdk.org/jdk/commit/5ba69e17340cf44194c080a38219c6e150418fcf Stats: 107 lines in 9 files changed: 68 ins; 1 del; 38 mod 8322477: order of subclasses in the permits clause can differ between compilations Reviewed-by: jlahoda ------------- PR: https://git.openjdk.org/jdk/pull/17284 From vicente.romero at oracle.com Wed Jan 10 18:02:19 2024 From: vicente.romero at oracle.com (Vicente Romero) Date: Wed, 10 Jan 2024 13:02:19 -0500 Subject: [private] Re: [External] : Re: [Bug] javac gives non-deterministic output (for sealed interface with records) In-Reply-To: References: <2e0d46a5-add6-4c98-b359-f8a4a4a6f1e2@oracle.com> <32306a3d-1376-4ec8-850b-f78eae103f1f@oracle.com> <8c26af0d-b0c5-410f-8db7-96e209707c90@oracle.com> Message-ID: <5d93c106-00d9-4342-a103-7ac4082bb4d4@oracle.com> Hi Przemek, The fix to the issue you reported [1] has been integrated in our master repo. Thanks a lot for all the help tracking this very interesting issue down, Thanks, Vicente [1] https://bugs.openjdk.org/browse/JDK-8322477 [2] https://github.com/openjdk/jdk On 1/9/24 11:04, Vicente Romero wrote: > Hi Przemek, > > this is pretty good, thanks for the reproducer. I will update the bug > entry, > > Thanks, > Vicente > > On 1/9/24 03:48, Przemek Bielicki wrote: >> Hey Vicente, >> >> My fellow Gradle JVM Platform engineer (Octavia Togami) created a >> reproducer: >> https://github.com/octylFractal/javac-permitted-ordering-bug >> >> Her first analysis was: "Looking at the stacktraces, it appears that >> when it's ordered properly, the subclasses of the sealed type are >> visited as part of their parent; but when it's ordered incorrectly, >> they're visited as part of resolving the type of a variable somewhere >> else." >> Eventually she says: "This is not in any way a Gradle bug. It has to >> do with ordering of other files that use the sealed type and its >> subclasses." >> >> Can you please verify this on your end and update the JIRA ticket >> with the latest findings? >> >> Thanks, >> Przemek > -------------- next part -------------- An HTML attachment was scrubbed... URL: From pbielicki at gmail.com Thu Jan 11 08:23:01 2024 From: pbielicki at gmail.com (Przemek Bielicki) Date: Thu, 11 Jan 2024 09:23:01 +0100 Subject: [private] Re: [External] : Re: [Bug] javac gives non-deterministic output (for sealed interface with records) In-Reply-To: <5d93c106-00d9-4342-a103-7ac4082bb4d4@oracle.com> References: <2e0d46a5-add6-4c98-b359-f8a4a4a6f1e2@oracle.com> <32306a3d-1376-4ec8-850b-f78eae103f1f@oracle.com> <8c26af0d-b0c5-410f-8db7-96e209707c90@oracle.com> <5d93c106-00d9-4342-a103-7ac4082bb4d4@oracle.com> Message-ID: Hi Vicente, This is great news! Will this fix be backported to earlier JDK versions? If so, then until which version? Ideally I would expect this fix to be a part of JDK 11. Cheers, Przemek On Wed, Jan 10, 2024 at 7:02?PM Vicente Romero wrote: > Hi Przemek, > > The fix to the issue you reported [1] has been integrated in our master > repo. Thanks a lot for all the help tracking this very interesting issue > down, > > Thanks, > Vicente > > [1] https://bugs.openjdk.org/browse/JDK-8322477 > [2] https://github.com/openjdk/jdk > > On 1/9/24 11:04, Vicente Romero wrote: > > Hi Przemek, > > this is pretty good, thanks for the reproducer. I will update the bug > entry, > > Thanks, > Vicente > > On 1/9/24 03:48, Przemek Bielicki wrote: > > Hey Vicente, > > My fellow Gradle JVM Platform engineer (Octavia Togami) created a > reproducer: https://github.com/octylFractal/javac-permitted-ordering-bug > > Her first analysis was: "Looking at the stacktraces, it appears that when > it's ordered properly, the subclasses of the sealed type are visited as > part of their parent; but when it's ordered incorrectly, they're visited as > part of resolving the type of a variable somewhere else." > Eventually she says: "This is not in any way a Gradle bug. It has to do > with ordering of other files that use the sealed type and its subclasses." > > Can you please verify this on your end and update the JIRA ticket with the > latest findings? > > Thanks, > Przemek > > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From abimpoudis at openjdk.org Thu Jan 11 11:51:30 2024 From: abimpoudis at openjdk.org (Aggelos Biboudis) Date: Thu, 11 Jan 2024 11:51:30 GMT Subject: RFR: 8303374: Compiler Implementation for Primitive types in patterns, instanceof, and switch (Preview) [v38] In-Reply-To: <3JvLQvkIPnCIy1JtnD6hKyVg2GvDUDvUqog8R7gbGJc=.21d55c1c-1476-4eea-8720-5424eda66678@github.com> References: <4GCkSMggtYI8KnM-kELHez3Nd42WIrfd6jOF1bbK5PA=.12aec6f3-669b-4675-ad34-ffe28cb23459@github.com> <3JvLQvkIPnCIy1JtnD6hKyVg2GvDUDvUqog8R7gbGJc=.21d55c1c-1476-4eea-8720-5424eda66678@github.com> Message-ID: On Thu, 14 Dec 2023 11:04:09 GMT, Aggelos Biboudis wrote: >> 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 54 commits: > > - Merge branch 'master' into primitive-patterns > - Cleanup > - Merge branch 'master' into primitive-patterns > - Remove trailing spaces > - Merge branch 'primitive-patterns-and-generating-dispatch' into primitive-patterns > - Fixed switch in the cases of unboxing and widening > - Merge branch 'JDK-8319220' into primitive-patterns > - Merge branch 'master' into JDK-8319220 > - reflecting review comment: fixing letter case. > - Reflecting review feedback. > - ... and 44 more: https://git.openjdk.org/jdk/compare/d2ba3b1e...a03fea7c Keep open ??? ------------- PR Comment: https://git.openjdk.org/jdk/pull/15638#issuecomment-1886978935 From jpai at openjdk.org Thu Jan 11 12:01:28 2024 From: jpai at openjdk.org (Jaikiran Pai) Date: Thu, 11 Jan 2024 12:01:28 GMT Subject: [jdk22] RFR: 8318971: Better Error Handling for Jar Tool When Processing Non-existent Files In-Reply-To: References: Message-ID: On Wed, 10 Jan 2024 17:42:21 GMT, Weibing Xiao wrote: > Better Error Handling for Jar Tool When Processing Non-existent Files.
> > It needs to be backported to JDK22. Clean backport of a P3 bug fix. ------------- Marked as reviewed by jpai (Reviewer). PR Review: https://git.openjdk.org/jdk22/pull/56#pullrequestreview-1815371942 From wxiao at openjdk.org Thu Jan 11 12:19:29 2024 From: wxiao at openjdk.org (Weibing Xiao) Date: Thu, 11 Jan 2024 12:19:29 GMT Subject: [jdk22] Integrated: 8318971: Better Error Handling for Jar Tool When Processing Non-existent Files In-Reply-To: References: Message-ID: On Wed, 10 Jan 2024 17:42:21 GMT, Weibing Xiao wrote: > Better Error Handling for Jar Tool When Processing Non-existent Files.
> > It needs to be backported to JDK22. This pull request has now been integrated. Changeset: 3daa936f Author: Weibing Xiao Committer: Jaikiran Pai URL: https://git.openjdk.org/jdk22/commit/3daa936f2da4da853e0cbe8dcb081e3a7509734f Stats: 86 lines in 2 files changed: 84 ins; 0 del; 2 mod 8318971: Better Error Handling for Jar Tool When Processing Non-existent Files Reviewed-by: jpai Backport-of: 8ae309ebacd6947bbad2ef168ca13702e1cba099 ------------- PR: https://git.openjdk.org/jdk22/pull/56 From prappo at openjdk.org Thu Jan 11 15:05:26 2024 From: prappo at openjdk.org (Pavel Rappo) Date: Thu, 11 Jan 2024 15:05:26 GMT Subject: RFR: JDK-8298405: Support Markdown in Documentation Comments [v6] In-Reply-To: References: <0ZVcM3Dh7buB7gX0Fznz29_x1I6gWJjPsao2vxVOuus=.49fe643e-a1e1-45c4-a7b5-6161721a1649@github.com> Message-ID: On Wed, 15 Nov 2023 00:21:10 GMT, Jonathan Gibbons wrote: > the output with the break iterator is now the same as the default simple iterator I can confirm that. Thanks. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/16388#discussion_r1448993923 From prappo at openjdk.org Thu Jan 11 15:10:29 2024 From: prappo at openjdk.org (Pavel Rappo) Date: Thu, 11 Jan 2024 15:10:29 GMT Subject: RFR: JDK-8298405: Support Markdown in Documentation Comments [v6] In-Reply-To: References: Message-ID: <3N5guZn5SiRlcjZrWQt0JbqUMJr79EcQ999JpVtx8-k=.cf3f71c3-4fcb-4958-b673-76b6b9797cd5@github.com> On Wed, 8 Nov 2023 16:24:20 GMT, Pavel Rappo wrote: >> Jonathan Gibbons 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 seven additional commits since the last revision: >> >> - Merge with upstream/master >> - Merge remote-tracking branch 'upstream/master' into 8298405.doclet-markdown-v3 >> - Address review comments >> - Fix whitespace >> - Improve handling of embedded inline taglets >> - Customize support for Markdown headings >> - JDK-8298405: Support Markdown in Documentation Comments > > test/langtools/tools/javac/classfiles/attributes/deprecated/DeprecatedTest.java line 26: > >> 24: /* >> 25: * @test >> 26: * @bug 8042261 8298405 > > This comment is not for this line, but for two compiler tests for `@deprecated` javadoc tag. It seemed quite contextual place to put it. > > Did I miss it, or you are planning to add a javadoc test that verifies that `@deprecated` appearing in a `///` comment has no [special meaning] it has in classic `/** */` comments? > > [special meaning]: https://github.com/openjdk/jdk/blob/128363bf3b57dfa05b3807271b47851733c1afb9/src/jdk.compiler/share/classes/com/sun/tools/javac/parser/JavaTokenizer.java#L1639-L1653 Ping. I do believe that it's important to have such a test. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/16388#discussion_r1449001056 From prappo at openjdk.org Thu Jan 11 15:38:23 2024 From: prappo at openjdk.org (Pavel Rappo) Date: Thu, 11 Jan 2024 15:38:23 GMT Subject: RFR: JDK-8298405: Support Markdown in Documentation Comments [v2] In-Reply-To: <0xaWRD1add432FW4NF8dhU3gi3q6BzPbhdnSMWKs2CY=.6ed27293-a889-4802-8e3f-e9f5d0a030e2@github.com> References: <0xaWRD1add432FW4NF8dhU3gi3q6BzPbhdnSMWKs2CY=.6ed27293-a889-4802-8e3f-e9f5d0a030e2@github.com> Message-ID: On Wed, 15 Nov 2023 18:48:59 GMT, Jonathan Gibbons wrote: >> Hmm. teeny-tiny "yes", dominated by a big "BUT". >> >> There is no easy simple direct support for Markdown in user-defined taglets, since there is no way to know the syntactic form of user-defined tags. We might be able to do something for user-defined tags given on the command line (with `-tag`) but in general we should be wary and think carefully about putting any headings inside any block tag, because block tags get converted to HTML definition lists. >> >> --- >> >> Separately, generally speaking, the Markdown headings in any doc comment should start at level 1 and increase from there. An offset will be added during translation to give the correct heading level in the overall page. There is a guard in the code (but no warning as yet) if you "overflow" heading level 6. For example, if you go overboard and use `#### my heading` in the comment for a method (where the offset for headings is 3), it will (currently) max out at level 6. Generating warnings for questionable Markdown is somewhat against the spirit of Markdown. It would seem a bit weird to warn against an obscure case like overflowing headings when the general policy for real errors is no message and just show the literal text. > > Update: > Markdown in tags defined by the user on the command-line works pretty much as expected: not great, but not bad. > > Headings in user-defined tags work, but are semantically questionable, since the tags are generated inside a definition list (which itself is maybe questionable, these days.). There is (currently) no special accommodation for the "virtual heading" in the presentation of the block tag. > > Headings, sections, HTML 5, Markdown and taglets are a complicated mess, and probably better discussed and tracked in JBS. Understood. FWIW, here are a few examples of headings in user-defined tags in JDK: https://github.com/openjdk/jdk/blob/a6785e4d633908596ddb6de6d2eeab1c9ebdf2c3/src/java.base/share/classes/java/math/BigDecimal.java#L229-L239 https://github.com/openjdk/jdk/blob/ddbbd36e4b064b9e7433f0a55973d72cd6dbc0d3/src/java.xml/share/classes/module-info.java#L402-L420 https://github.com/openjdk/jdk/blob/6f6486e97743eadfb20b4175e1b4b2b05b59a17a/src/jdk.incubator.vector/share/classes/jdk/incubator/vector/Vector.java#L1089-L1093 ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/16388#discussion_r1449039906 From vromero at openjdk.org Thu Jan 11 18:06:25 2024 From: vromero at openjdk.org (Vicente Romero) Date: Thu, 11 Jan 2024 18:06:25 GMT Subject: [jdk22] RFR: 8322003: JShell - Incorrect type inference in lists of records implementing interfaces In-Reply-To: References: Message-ID: On Mon, 8 Jan 2024 14:21:24 GMT, Jan Lahoda wrote: > Hi all, > > This pull request contains a backport of commit [57a65fe4](https://github.com/openjdk/jdk/commit/57a65fe436a3617d64bbf0b02d4c7f7c2551448f) from the [openjdk/jdk](https://git.openjdk.org/jdk) repository. > > The commit being backported was authored by Jan Lahoda on 8 Jan 2024 and was reviewed by Vicente Romero. > > Thanks! looks good ------------- Marked as reviewed by vromero (Reviewer). PR Review: https://git.openjdk.org/jdk22/pull/40#pullrequestreview-1816186760 From vromero at openjdk.org Thu Jan 11 18:41:24 2024 From: vromero at openjdk.org (Vicente Romero) Date: Thu, 11 Jan 2024 18:41:24 GMT Subject: RFR: 8323057: Recoverable errors may be reported before unrecoverable errors when annotation processing is skipped In-Reply-To: References: Message-ID: On Fri, 5 Jan 2024 19:51:35 GMT, Jan Lahoda wrote: > When annotation processing is requested, some errors reported during enter may be resolved by the annotation processors. So, javac stashes the errors from enter aside. When an error that cannot be resolved by annotation processing is found in the stashed errors, the annotation processors all the errors will be printed. > > This may be confusing if there's one important non-resolvable error, hidden among many errors that would be resolved by the annotation processors. The proposal herein is therefore to first print the not-recoverable errors, and only then the recoverable errors, when the errors are stashed away and then re-printed. looks good, minor suggestion, there is no need for a re-review test/langtools/tools/javac/processing/errors/TestErrorOrder.java line 69: > 67: Path src = outerBase.resolve("src"); > 68: tb.writeJavaFiles(src, > 69: "package t;\n" + please consider using text blocks ------------- Marked as reviewed by vromero (Reviewer). PR Review: https://git.openjdk.org/jdk/pull/17286#pullrequestreview-1816278586 PR Review Comment: https://git.openjdk.org/jdk/pull/17286#discussion_r1449255942 From darcy at openjdk.org Thu Jan 11 19:31:32 2024 From: darcy at openjdk.org (Joe Darcy) Date: Thu, 11 Jan 2024 19:31:32 GMT Subject: RFR: JDK-8042981: Strip type annotations in Types' utility methods [v3] In-Reply-To: References: Message-ID: > Early review for JDK-8042981: "Strip type annotations in Types' utility methods". I work more often in the Element world rather than the Type word of the annotation processing APIs. > > The type annotations on primitive types are *not* cleared by the existing annotation clearing mechanisms. I suspect Type.Visitor is missing a case for primitive types. Someone with familiarity with javac's type modeling should take a look; thanks. Joe Darcy 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 seven additional commits since the last revision: - Merge branch 'master' into JDK-8042981 - Intermediate commit; add stripAnnotations method. - Merge branch 'master' into JDK-8042981 - Merge branch 'master' into JDK-8042981 - Update visitor; all langtools regression tests pass. - Merge branch 'master' into JDK-8042981 - JDK-8042981: Strip type annotations in Types' utility methods ------------- Changes: - all: https://git.openjdk.org/jdk/pull/8984/files - new: https://git.openjdk.org/jdk/pull/8984/files/0dacb981..61cf9717 Webrevs: - full: https://webrevs.openjdk.org/?repo=jdk&pr=8984&range=02 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=8984&range=01-02 Stats: 2480805 lines in 22680 files changed: 1276520 ins; 922281 del; 282004 mod Patch: https://git.openjdk.org/jdk/pull/8984.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/8984/head:pull/8984 PR: https://git.openjdk.org/jdk/pull/8984 From darcy at openjdk.org Fri Jan 12 00:13:04 2024 From: darcy at openjdk.org (Joe Darcy) Date: Fri, 12 Jan 2024 00:13:04 GMT Subject: RFR: JDK-8042981: Strip type annotations in Types' utility methods [v4] In-Reply-To: References: Message-ID: <8Y9bRg1fmwtK_bixYBf8pk80bhh3yVpKyEnZTi6k4mY=.050ec663-77b1-4407-a5d6-7c8b5a12e6b3@github.com> > Early review for JDK-8042981: "Strip type annotations in Types' utility methods". I work more often in the Element world rather than the Type word of the annotation processing APIs. > > The type annotations on primitive types are *not* cleared by the existing annotation clearing mechanisms. I suspect Type.Visitor is missing a case for primitive types. Someone with familiarity with javac's type modeling should take a look; thanks. Joe Darcy has updated the pull request incrementally with one additional commit since the last revision: Add changes from Liam. ------------- Changes: - all: https://git.openjdk.org/jdk/pull/8984/files - new: https://git.openjdk.org/jdk/pull/8984/files/61cf9717..78d4c299 Webrevs: - full: https://webrevs.openjdk.org/?repo=jdk&pr=8984&range=03 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=8984&range=02-03 Stats: 73 lines in 4 files changed: 13 ins; 37 del; 23 mod Patch: https://git.openjdk.org/jdk/pull/8984.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/8984/head:pull/8984 PR: https://git.openjdk.org/jdk/pull/8984 From darcy at openjdk.org Fri Jan 12 07:27:26 2024 From: darcy at openjdk.org (Joe Darcy) Date: Fri, 12 Jan 2024 07:27:26 GMT Subject: RFR: JDK-8042981: Strip type annotations in Types' utility methods [v5] In-Reply-To: References: Message-ID: <9mAqXAAjAmhg90Yf_7fuGFridDdRXJ78q1vlJx50T9c=.d0eb9c81-6cbf-4459-b36c-18058722bb50@github.com> > Early review for JDK-8042981: "Strip type annotations in Types' utility methods". I work more often in the Element world rather than the Type word of the annotation processing APIs. > > The type annotations on primitive types are *not* cleared by the existing annotation clearing mechanisms. I suspect Type.Visitor is missing a case for primitive types. Someone with familiarity with javac's type modeling should take a look; thanks. Joe Darcy has updated the pull request incrementally with one additional commit since the last revision: Update implementation and tests. ------------- Changes: - all: https://git.openjdk.org/jdk/pull/8984/files - new: https://git.openjdk.org/jdk/pull/8984/files/78d4c299..e9200876 Webrevs: - full: https://webrevs.openjdk.org/?repo=jdk&pr=8984&range=04 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=8984&range=03-04 Stats: 141 lines in 3 files changed: 114 ins; 0 del; 27 mod Patch: https://git.openjdk.org/jdk/pull/8984.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/8984/head:pull/8984 PR: https://git.openjdk.org/jdk/pull/8984 From darcy at openjdk.org Fri Jan 12 07:32:33 2024 From: darcy at openjdk.org (Joe Darcy) Date: Fri, 12 Jan 2024 07:32:33 GMT Subject: RFR: JDK-8042981: Strip type annotations in Types' utility methods [v2] In-Reply-To: References: Message-ID: On Wed, 3 Jan 2024 23:26:22 GMT, Liam Miller-Cushon wrote: >> Joe Darcy 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 three additional commits since the last revision: >> >> - Update visitor; all langtools regression tests pass. >> - Merge branch 'master' into JDK-8042981 >> - JDK-8042981: Strip type annotations in Types' utility methods > > I cleaned up the approach described in https://github.com/openjdk/jdk/pull/8984#issuecomment-1806211798 and have a draft with those changes applied on top of the work in this PR: https://github.com/openjdk/jdk/pull/17256. It passes the tests added in this PR, with the disabled cases re-enabled. > > @jddarcy what do you think of that approach? After adding some code from @cushon to get past a roadblock, the PR is back on track. Thanks @cushon! Please (re)review the API and implementation changes. The testing seems to have uncovered a bug where the methods getAnnotation(Class annotationType) getAnnotationsByType(Class annotationType) getAnnotationsByType(Class annotationType) when called on a TypeMirror always return an empty result even when annotations are present. Commenting out the overrides in Type and using the code from AnnoConstruct seems to fix this and all regression tests pass. I can file a separate bug for that issue however and remove the portions of TestAnnotationStripping that would fail without that fix. ------------- PR Comment: https://git.openjdk.org/jdk/pull/8984#issuecomment-1888564131 From jlahoda at openjdk.org Fri Jan 12 10:04:22 2024 From: jlahoda at openjdk.org (Jan Lahoda) Date: Fri, 12 Jan 2024 10:04:22 GMT Subject: [jdk22] Integrated: 8322003: JShell - Incorrect type inference in lists of records implementing interfaces In-Reply-To: References: Message-ID: On Mon, 8 Jan 2024 14:21:24 GMT, Jan Lahoda wrote: > Hi all, > > This pull request contains a backport of commit [57a65fe4](https://github.com/openjdk/jdk/commit/57a65fe436a3617d64bbf0b02d4c7f7c2551448f) from the [openjdk/jdk](https://git.openjdk.org/jdk) repository. > > The commit being backported was authored by Jan Lahoda on 8 Jan 2024 and was reviewed by Vicente Romero. > > Thanks! This pull request has now been integrated. Changeset: 07a8911c Author: Jan Lahoda URL: https://git.openjdk.org/jdk22/commit/07a8911ce8d6c0e791544c0fd38e04d9a5ca2cd5 Stats: 121 lines in 3 files changed: 87 ins; 11 del; 23 mod 8322003: JShell - Incorrect type inference in lists of records implementing interfaces Reviewed-by: vromero Backport-of: 57a65fe436a3617d64bbf0b02d4c7f7c2551448f ------------- PR: https://git.openjdk.org/jdk22/pull/40 From prappo at openjdk.org Fri Jan 12 12:39:27 2024 From: prappo at openjdk.org (Pavel Rappo) Date: Fri, 12 Jan 2024 12:39:27 GMT Subject: RFR: JDK-8298405: Support Markdown in Documentation Comments [v6] In-Reply-To: <0mlIFIZ2ec8oE2zlmKxoMwp59dBgOdUQs-vzTLnU7hI=.15fa2827-8c87-415b-ab74-0e42b45a5cf7@github.com> References: <0mlIFIZ2ec8oE2zlmKxoMwp59dBgOdUQs-vzTLnU7hI=.15fa2827-8c87-415b-ab74-0e42b45a5cf7@github.com> Message-ID: On Mon, 8 Jan 2024 21:26:50 GMT, Jonathan Gibbons wrote: >> Please review a patch to add support for Markdown syntax in documentation comments, as described in the associated JEP. >> >> Notable features: >> >> * support for `///` documentation comments in `JavaTokenizer` >> * new module `jdk.internal.md` -- a private copy of the `commonmark-java` library >> * updates to `DocCommentParser` to treat `///` comments as Markdown >> * updates to the standard doclet to render Markdown comments in HTML > > Jonathan Gibbons 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 seven additional commits since the last revision: > > - Merge with upstream/master > - Merge remote-tracking branch 'upstream/master' into 8298405.doclet-markdown-v3 > - Address review comments > - Fix whitespace > - Improve handling of embedded inline taglets > - Customize support for Markdown headings > - JDK-8298405: Support Markdown in Documentation Comments On CommonMark. * `jdk.internal.md` contains 133 files, the vast majority of which are from commonmark-java 0.21.0. According to https://github.com/commonmark/commonmark-java/releases 0.21.0 is the latest/current release; good. Questions: * Did we take the tagged commit or mainline at some point after the tagged commit? If it's the latter, we need to take the tagged version. * What's the difference between those commonmark-java files in this PR and official commonmark-java? In other words, how do we adapt them? It would be nice to have a description of the procedure or a script to update those files. * `jdk.internal.md` exports packages to `jdk.jshell`. A question for @lahodaj, who maintains `jdk.jshell`: when do we need to create a new PR similar to that withdrawn https://github.com/openjdk/jdk/pull/11936? src/jdk.internal.md/share/classes/jdk/internal/markdown/MarkdownTransformer.java line 2: > 1: /* > 2: * Copyright (c) 2005, 2023, Oracle and/or its affiliates. All rights reserved. It's surprising to see 2005. src/jdk.internal.md/share/classes/module-info.java line 29: > 27: * Internal support for Markdown. > 28: * > 29: * @since 22 Suggestion: * @since 23 ------------- PR Review: https://git.openjdk.org/jdk/pull/16388#pullrequestreview-1818084469 PR Review Comment: https://git.openjdk.org/jdk/pull/16388#discussion_r1450342017 PR Review Comment: https://git.openjdk.org/jdk/pull/16388#discussion_r1450347103 From cushon at openjdk.org Fri Jan 12 20:34:26 2024 From: cushon at openjdk.org (Liam Miller-Cushon) Date: Fri, 12 Jan 2024 20:34:26 GMT Subject: RFR: JDK-8042981: Strip type annotations in Types' utility methods [v5] In-Reply-To: <9mAqXAAjAmhg90Yf_7fuGFridDdRXJ78q1vlJx50T9c=.d0eb9c81-6cbf-4459-b36c-18058722bb50@github.com> References: <9mAqXAAjAmhg90Yf_7fuGFridDdRXJ78q1vlJx50T9c=.d0eb9c81-6cbf-4459-b36c-18058722bb50@github.com> Message-ID: On Fri, 12 Jan 2024 07:27:26 GMT, Joe Darcy wrote: >> Early review for JDK-8042981: "Strip type annotations in Types' utility methods". I work more often in the Element world rather than the Type word of the annotation processing APIs. >> >> The type annotations on primitive types are *not* cleared by the existing annotation clearing mechanisms. I suspect Type.Visitor is missing a case for primitive types. Someone with familiarity with javac's type modeling should take a look; thanks. > > Joe Darcy has updated the pull request incrementally with one additional commit since the last revision: > > Update implementation and tests. Thanks! re: `TypeMirror #TypeMirror#getAnnotation*(Class)`, I agree that's a bug, and also that it probably warrants a separate issue. src/jdk.compiler/share/classes/com/sun/tools/javac/code/Type.java line 429: > 427: } > 428: //where > 429: private static final TypeMapping stripMetadata = new StructuralTypeMapping() { It might be worth adding an implementation comment here to note that the visitor only needs to handle are the ones where 'contained' types can be annotated, which are the cases described by JVMS 4.7.20.2: classes (for type parameters and enclosing types), wildcards, and arrays. test/langtools/tools/javac/processing/model/util/types/TestAnnotationStripping.java line 140: > 138: } > 139: > 140: void checkEmptyAnnotations(AnnotatedConstruct ac) { I think it would be valuable to expand the assertion to visit contained types, and assert that none of the contained types have annotations: diff --git a/test/langtools/tools/javac/processing/model/util/types/TestAnnotationStripping.java b/test/langtools/tools/javac/processing/model/util/types/TestAnnotationStripping.java index c627f41ba0b..8bb3c7cd3a8 100644 --- a/test/langtools/tools/javac/processing/model/util/types/TestAnnotationStripping.java +++ b/test/langtools/tools/javac/processing/model/util/types/TestAnnotationStripping.java @@ -82,10 +82,10 @@ public boolean process(Set annotations, System.err.print("\tgetArrayType()"); ArrayType arrayType = typeUtils.getArrayType(returnType); - checkEmptyAnnotations(arrayType); /* * "Annotations on the component type are preserved." */ + checkEmptyAnnotations((AnnotatedConstruct) arrayType); checkEqualTypeAndAnnotations(returnType, arrayType.getComponentType()); if (!returnType.getKind().isPrimitive()) { @@ -93,10 +93,14 @@ public boolean process(Set annotations, * "Annotations on the bounds are preserved." */ WildcardType wcType; - checkEmptyAnnotations(wcType = typeUtils.getWildcardType(returnType, null)); + System.err.print("\tgetWildcardType(returnType, null)"); + wcType = typeUtils.getWildcardType(returnType, null); + checkEmptyAnnotations((AnnotatedConstruct) wcType); checkEqualTypeAndAnnotations(returnType, wcType.getExtendsBound()); - checkEmptyAnnotations(wcType = typeUtils.getWildcardType(null, returnType)); + System.err.print("\tgetWildcardType(null, returnType)"); + wcType = typeUtils.getWildcardType(null, returnType); + checkEmptyAnnotations((AnnotatedConstruct) wcType); checkEqualTypeAndAnnotations(returnType, wcType.getSuperBound()); } @@ -158,6 +162,54 @@ void checkEmptyAnnotations(AnnotatedConstruct ac) { } } + void checkEmptyAnnotations(TypeMirror ac) { + System.err.println("\t" + ac); + if (ac == null) { + return; + } + new SimpleTypeVisitor14() { + @Override + protected Void defaultAction(TypeMirror t, Void o) { + checkEmptyAnnotations((AnnotatedConstruct) t); + return null; + } + + @Override + public Void visitArray(ArrayType t, Void o) { + scan(t.getComponentType()); + return super.visitArray(t, o); + } + + @Override + public Void visitDeclared(DeclaredType t, Void o) { + scan(t.getEnclosingType()); + t.getTypeArguments().stream().forEach(this::scan); + return super.visitDeclared(t, o); + } + + @Override + public Void visitTypeVariable(TypeVariable t, Void o) { + // the bounds correspond to the type variable declaration, not its use + // scan(t.getUpperBound()); + // scan(t.getLowerBound()); + return super.visitTypeVariable(t, o); + } + + @Override + public Void visitWildcard(WildcardType t, Void o) { + scan(t.getExtendsBound()); + scan(t.getSuperBound()); + return super.visitWildcard(t, o); + } + + private void scan(TypeMirror t) { + if (t != null) { + visit(t); + } + } + }.visit(ac); + } + void checkEqualTypeAndAnnotations(TypeMirror tm1, TypeMirror tm2) { if (!typeUtils.isSameType(tm1, tm2)) { failures++; test/langtools/tools/javac/processing/model/util/types/TestAnnotationStripping.java line 189: > 187: public static String @TestTypeAnnotation("foo5")[] foo5() {return null;} > 188: > 189: public static java.util. @TestTypeAnnotation("foo6") Set < @TestTypeAnnotation("foo7") String> foo6() {return null;} Consider adding a case for type variable usages: public static <@TestTypeAnnotation("foo8") T extends @TestTypeAnnotation("foo9") String> @TestTypeAnnotation("foo10") T foo8() {return null;} This one raises a couple of questions about type annotations associated with the declaration of the type variable. I think probably only the annotations on the use of the type var need to be stripped, not the declaration. Currently this causes failures for the assertion that `asElement()` has no annotations, because the annotations are only stripped from the type corresponding to the use of the type variable, not from the corresponding declaration. Similarly `TypeVariable#getUpperBound` would report annotations. ------------- PR Review: https://git.openjdk.org/jdk/pull/8984#pullrequestreview-1818788534 PR Review Comment: https://git.openjdk.org/jdk/pull/8984#discussion_r1450775093 PR Review Comment: https://git.openjdk.org/jdk/pull/8984#discussion_r1450896707 PR Review Comment: https://git.openjdk.org/jdk/pull/8984#discussion_r1450895756 From darcy at openjdk.org Fri Jan 12 20:46:26 2024 From: darcy at openjdk.org (Joe Darcy) Date: Fri, 12 Jan 2024 20:46:26 GMT Subject: RFR: JDK-8042981: Strip type annotations in Types' utility methods [v5] In-Reply-To: References: <9mAqXAAjAmhg90Yf_7fuGFridDdRXJ78q1vlJx50T9c=.d0eb9c81-6cbf-4459-b36c-18058722bb50@github.com> Message-ID: On Fri, 12 Jan 2024 20:31:42 GMT, Liam Miller-Cushon wrote: > Thanks! > > re: `TypeMirror #TypeMirror#getAnnotation*(Class)`, I agree that's a bug, and also that it probably warrants a separate issue. Filed JDK-8323684: TypeMirror.{getAnnotationsByType, getAnnotation} return uninformative results. ------------- PR Comment: https://git.openjdk.org/jdk/pull/8984#issuecomment-1889925740 From darcy at openjdk.org Sat Jan 13 01:33:21 2024 From: darcy at openjdk.org (Joe Darcy) Date: Sat, 13 Jan 2024 01:33:21 GMT Subject: RFR: JDK-8042981: Strip type annotations in Types' utility methods [v6] In-Reply-To: References: Message-ID: > Early review for JDK-8042981: "Strip type annotations in Types' utility methods". I work more often in the Element world rather than the Type word of the annotation processing APIs. > > The type annotations on primitive types are *not* cleared by the existing annotation clearing mechanisms. I suspect Type.Visitor is missing a case for primitive types. Someone with familiarity with javac's type modeling should take a look; thanks. Joe Darcy 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 10 additional commits since the last revision: - Merge branch 'master' into JDK-8042981 - Update implementation and tests. - Add changes from Liam. - Merge branch 'master' into JDK-8042981 - Intermediate commit; add stripAnnotations method. - Merge branch 'master' into JDK-8042981 - Merge branch 'master' into JDK-8042981 - Update visitor; all langtools regression tests pass. - Merge branch 'master' into JDK-8042981 - JDK-8042981: Strip type annotations in Types' utility methods ------------- Changes: - all: https://git.openjdk.org/jdk/pull/8984/files - new: https://git.openjdk.org/jdk/pull/8984/files/e9200876..342b091f Webrevs: - full: https://webrevs.openjdk.org/?repo=jdk&pr=8984&range=05 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=8984&range=04-05 Stats: 11303 lines in 313 files changed: 6324 ins; 3810 del; 1169 mod Patch: https://git.openjdk.org/jdk/pull/8984.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/8984/head:pull/8984 PR: https://git.openjdk.org/jdk/pull/8984 From darcy at openjdk.org Sat Jan 13 01:36:49 2024 From: darcy at openjdk.org (Joe Darcy) Date: Sat, 13 Jan 2024 01:36:49 GMT Subject: RFR: JDK-8042981: Strip type annotations in Types' utility methods [v7] In-Reply-To: References: Message-ID: > Early review for JDK-8042981: "Strip type annotations in Types' utility methods". I work more often in the Element world rather than the Type word of the annotation processing APIs. > > The type annotations on primitive types are *not* cleared by the existing annotation clearing mechanisms. I suspect Type.Visitor is missing a case for primitive types. Someone with familiarity with javac's type modeling should take a look; thanks. Joe Darcy has updated the pull request incrementally with one additional commit since the last revision: Revert changes that will be done under JDK-8323684. ------------- Changes: - all: https://git.openjdk.org/jdk/pull/8984/files - new: https://git.openjdk.org/jdk/pull/8984/files/342b091f..e389818d Webrevs: - full: https://webrevs.openjdk.org/?repo=jdk&pr=8984&range=06 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=8984&range=05-06 Stats: 16 lines in 2 files changed: 0 ins; 1 del; 15 mod Patch: https://git.openjdk.org/jdk/pull/8984.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/8984/head:pull/8984 PR: https://git.openjdk.org/jdk/pull/8984 From darcy at openjdk.org Sat Jan 13 02:00:25 2024 From: darcy at openjdk.org (Joe Darcy) Date: Sat, 13 Jan 2024 02:00:25 GMT Subject: RFR: JDK-8042981: Strip type annotations in Types' utility methods [v5] In-Reply-To: References: <9mAqXAAjAmhg90Yf_7fuGFridDdRXJ78q1vlJx50T9c=.d0eb9c81-6cbf-4459-b36c-18058722bb50@github.com> Message-ID: On Fri, 12 Jan 2024 20:43:36 GMT, Joe Darcy wrote: > > Thanks! > > re: `TypeMirror #TypeMirror#getAnnotation*(Class)`, I agree that's a bug, and also that it probably warrants a separate issue. > > Filed JDK-8323684: TypeMirror.{getAnnotationsByType, getAnnotation} return uninformative results. Review of that fix will occur under https://github.com/openjdk/jdk/pull/17410 ------------- PR Comment: https://git.openjdk.org/jdk/pull/8984#issuecomment-1890248448 From attila.kelemen85 at gmail.com Sat Jan 13 12:38:06 2024 From: attila.kelemen85 at gmail.com (Attila Kelemen) Date: Sat, 13 Jan 2024 13:38:06 +0100 Subject: ? extend T[] is not considered an array Message-ID: Hi, I have not found anything in JLS specifically mentioning this. So, I'm not sure if it is intentional, but the following code does not compile (in any versions of Java I have tried): ``` interface ForEachable { void forEach(Consumer consumer); } List wrongMethod(ForEachable arrays) { var result = new ArrayList(); arrays.forEach(array -> result.add(array[0])); return result; } ``` or in an even simpler example: ``` String first(Supplier supplier) { return supplier.get()[0]; } ``` The compiler complains about `array[0]` that `array` is not an array. While I get that the compiler cannot assume that there is no subtype of `String[]`, but even if there was one, I would expect it to be an array, and be indexable. An obvious workaround is to assign `array` to a new local variable, but it is awkward to do. Is this behavior a bug, or something required by the JLS? Thanks, Attila -------------- next part -------------- An HTML attachment was scrubbed... URL: From liach at openjdk.org Sun Jan 14 16:33:36 2024 From: liach at openjdk.org (Chen Liang) Date: Sun, 14 Jan 2024 16:33:36 GMT Subject: RFR: 8323707: Adjust Classfile API's type arg model to better represent the embodied type Message-ID: API changes as discussed on the mailing list: https://mail.openjdk.org/pipermail/classfile-api-dev/2023-November/000419.html Additional questions: 1. Whether to rename `WildcardIndicator.DEFAULT` to `NONE` ------------- Commit messages: - redundant line - Fix a test in langtools, copyright year - Merge branch 'master' of https://github.com/openjdk/jdk into fix/typearg-model - Implementation cleanup, test update - Merge branch 'master' into fix/typearg-model - Formatting - Nuke signatureString and fix test fialure from bad cast - Adjust the type arg model to better represent the embodied type Changes: https://git.openjdk.org/jdk/pull/16517/files Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=16517&range=00 Issue: https://bugs.openjdk.org/browse/JDK-8323707 Stats: 130 lines in 6 files changed: 46 ins; 32 del; 52 mod Patch: https://git.openjdk.org/jdk/pull/16517.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/16517/head:pull/16517 PR: https://git.openjdk.org/jdk/pull/16517 From duke at openjdk.org Sun Jan 14 16:33:37 2024 From: duke at openjdk.org (ExE Boss) Date: Sun, 14 Jan 2024 16:33:37 GMT Subject: RFR: 8323707: Adjust Classfile API's type arg model to better represent the embodied type In-Reply-To: References: Message-ID: <_yj_29oiqHBjdbwOPy8MC4uPQBScN5FpsG-Ah_QTW-g=.db327b2e-9f22-4804-973f-3e631ce8e782@github.com> On Mon, 6 Nov 2023 07:30:41 GMT, Chen Liang wrote: > API changes as discussed on the mailing list: https://mail.openjdk.org/pipermail/classfile-api-dev/2023-November/000419.html > > Additional questions: > 1. Whether to rename `WildcardIndicator.DEFAULT` to `NONE` src/java.base/share/classes/jdk/internal/classfile/Signature.java line 252: > 250: public static TypeArg.Bounded bounded(Bounded.WildcardIndicator wildcard, RefTypeSig boundType) { > 251: return new SignaturesImpl.TypeArgImpl(wildcard, boundType); > 252: } Suggestion: public static TypeArg.Bounded bounded(Bounded.WildcardIndicator wildcard, RefTypeSig boundType) { requireNonNull(wildcard); requireNonNull(boundType); return new SignaturesImpl.TypeArgImpl(wildcard, boundType); } ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/16517#discussion_r1405426776 From duke at openjdk.org Mon Jan 15 02:33:21 2024 From: duke at openjdk.org (ExE Boss) Date: Mon, 15 Jan 2024 02:33:21 GMT Subject: RFR: 8323707: Adjust Classfile API's type arg model to better represent the embodied type In-Reply-To: References: Message-ID: On Mon, 6 Nov 2023 07:30:41 GMT, Chen Liang wrote: > API changes as discussed on the mailing list: https://mail.openjdk.org/pipermail/classfile-api-dev/2023-November/000419.html > > Additional questions: > 1. Whether to rename `WildcardIndicator.DEFAULT` to `NONE` src/java.base/share/classes/java/lang/classfile/Signature.java line 219: > 217: * no wildcard (empty), an exact type > 218: */ > 219: DEFAULT, I?m?personally in?favour of?naming this?`NONE`. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/16517#discussion_r1451876203 From prappo at openjdk.org Mon Jan 15 14:04:44 2024 From: prappo at openjdk.org (Pavel Rappo) Date: Mon, 15 Jan 2024 14:04:44 GMT Subject: RFR: JDK-8298405: Support Markdown in Documentation Comments [v6] In-Reply-To: <0mlIFIZ2ec8oE2zlmKxoMwp59dBgOdUQs-vzTLnU7hI=.15fa2827-8c87-415b-ab74-0e42b45a5cf7@github.com> References: <0mlIFIZ2ec8oE2zlmKxoMwp59dBgOdUQs-vzTLnU7hI=.15fa2827-8c87-415b-ab74-0e42b45a5cf7@github.com> Message-ID: <6df9dQzBK0M7SlHDpNO4T_bhE7i6WqwLP64cs6Df9A8=.e08f76a3-8753-4bad-9325-b0ab042645a4@github.com> On Mon, 8 Jan 2024 21:26:50 GMT, Jonathan Gibbons wrote: >> Please review a patch to add support for Markdown syntax in documentation comments, as described in the associated JEP. >> >> Notable features: >> >> * support for `///` documentation comments in `JavaTokenizer` >> * new module `jdk.internal.md` -- a private copy of the `commonmark-java` library >> * updates to `DocCommentParser` to treat `///` comments as Markdown >> * updates to the standard doclet to render Markdown comments in HTML > > Jonathan Gibbons 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 seven additional commits since the last revision: > > - Merge with upstream/master > - Merge remote-tracking branch 'upstream/master' into 8298405.doclet-markdown-v3 > - Address review comments > - Fix whitespace > - Improve handling of embedded inline taglets > - Customize support for Markdown headings > - JDK-8298405: Support Markdown in Documentation Comments Here's another batch of comments. Please update `@since 22` to `@since 23` throughout this PR. src/jdk.compiler/share/classes/com/sun/source/doctree/DocTreeVisitor.java line 257: > 255: * > 256: * @implSpec Visits the provided {@code RawTextTree} node > 257: * by calling {@code visitOther(node, p)}. Nit: for consistency with the rest of the file, reorder `@param`-`@return` block with the `@implSpec` tag: Suggestion: * * @implSpec Visits the provided {@code RawTextTree} node * by calling {@code visitOther(node, p)}. * * @param node the node being visited * @param p a parameter value * @return a result value src/jdk.compiler/share/classes/com/sun/source/doctree/RawTextTree.java line 40: > 38: * @apiNote > 39: * This class may be used to represent tree nodes containing > 40: * {@linkplain DocTree.Kind#MARKDOWN Markdown} text. This means that there is one-to-many relationship between `RawTextTree` and `DocTree.KIND`. This in turn perpetuates the pattern of checking the kind followed by casting as opposed to more modern `instanceof` pattern matching. There's nothing wrong with it per se, however I wonder what the rationale is for leaving this part of the API open-ended. Is it to support other types of raw text in the future? src/jdk.compiler/share/classes/com/sun/source/util/DocTreeFactory.java line 299: > 297: * @param code the code > 298: * @return a {@code RawTextTree} object > 299: * @throws IllegalArgumentException if the kind is not a recognized kind for raw text This method's implementation also throws `NullPointerException` if kind is null, which is unusual for these methods. You can either add `@throws`, or workaround it by using `String.valueOf(kind)` instead of `kind.toString()` down in the implementation. src/jdk.compiler/share/classes/com/sun/source/util/DocTreeFactory.java line 303: > 301: * @since 22 > 302: */ > 303: RawTextTree newRawTextTree(DocTree.Kind kind, String code) throws IllegalArgumentException; It's unusual for a JDK method to declare a runtime exception. src/jdk.compiler/share/classes/com/sun/source/util/DocTrees.java line 97: > 95: */ > 96: public enum CommentKind { > 97: /** The style of comments whose lines are prefixed by{@code ///}. */ Suggestion: /** The style of comments whose lines are prefixed by {@code ///}. */ src/jdk.compiler/share/classes/com/sun/source/util/DocTrees.java line 104: > 102: > 103: /** > 104: * {@return the style of the documentation comment associated with a tree node.} Period is redundant: Suggestion: * {@return the style of the documentation comment associated with a tree node} src/jdk.compiler/share/classes/com/sun/source/util/DocTrees.java line 111: > 109: * @since 22 > 110: */ > 111: public abstract CommentKind getDocCommentKind(TreePath path); This method's specification says nothing about `null` that the implementation can return. src/jdk.compiler/share/classes/com/sun/source/util/DocTrees.java line 157: > 155: * @param fileObject the content container > 156: * @return the doc comment tree > 157: * @throws IllegalArgumentException if the file type is not supported It seems like this exception could've been thrown before, it's just that you have documented it for the first time. This might be important for CSR. src/jdk.compiler/share/classes/com/sun/source/util/DocTrees.java line 182: > 180: * @return the doc comment tree > 181: * @throws IOException if an exception occurs > 182: * @throws IllegalArgumentException if the file type is not supported Ditto on this newly documented exception. src/jdk.compiler/share/classes/com/sun/source/util/DocTrees.java line 193: > 191: * > 192: * Supported file types are HTML files and Markdown files. > 193: * Future releases may support additional file types. Good catch on this missing statement, which is present in other similar methods. src/jdk.compiler/share/classes/com/sun/source/util/DocTrees.java line 297: > 295: > 296: /** > 297: * A functional interface to transform a {@code DocCommentTree}. Re: functional interface If you mean it, annotate it with `@FunctionalInterface`. If you don't, simply remove that phrase. src/jdk.compiler/share/classes/com/sun/source/util/DocTrees.java line 309: > 307: * The standard implementation of this interface supports an extended form > 308: * of reference links in Markdown comments, such that if the label for a > 309: * reference link is undefined and matches a reference to a program Suggestion: * reference link is undefined and resembles a reference to a program src/jdk.compiler/share/classes/com/sun/source/util/DocTrees.java line 329: > 327: * Transforms a documentation comment tree. > 328: * > 329: * @param trees an instance of the {@link Trees} utility interface. Suggestion: * @param trees an instance of the {@link Trees} utility interface src/jdk.compiler/share/classes/com/sun/tools/javac/api/JavacTrees.java line 992: > 990: > 991: private static boolean isMarkdownFile(FileObject fo) { > 992: return fo.getName().endsWith(".md"); I wonder why you decided to (re)implement those methods using file extension matching. Is it because we don't want to introduce anything Markdown-related to this method that was used to implement `isHtmlFile` previously? https://github.com/openjdk/jdk/blob/8eb4e7e07e9211aabcb0f22696e9c572dac7a59f/src/jdk.compiler/share/classes/com/sun/tools/javac/file/BaseFileManager.java#L489-L498 src/jdk.compiler/share/classes/com/sun/tools/javac/api/JavacTrees.java line 1080: > 1078: } > 1079: > 1080: private String info(FileObject fo) { This does not seem to be used; is it for debugging? If so, add your `// DEBUG` comment. src/jdk.compiler/share/classes/com/sun/tools/javac/api/JavacTrees.java line 1156: > 1154: > 1155: /** > 1156: * {@return the {@linkplain ParserFactory} parser factory}. Suggestion: * {@return the {@linkplain ParserFactory} parser factory} src/jdk.compiler/share/classes/com/sun/tools/javac/parser/DocCommentParser.java line 89: > 87: POSTAMBLE, > 88: /** The rich-text content of an inline documentation comment tag. */ > 89: INLINE Do we also need to say something about `.md` files here? src/jdk.compiler/share/classes/com/sun/tools/javac/parser/DocCommentParser.java line 130: > 128: > 129: /** > 130: * Create a parser for a documentation comment. Suggestion: * Creates a parser for a documentation comment. src/jdk.compiler/share/classes/com/sun/tools/javac/parser/DocCommentParser.java line 201: > 199: } > 200: newline = true; > 201: } I can see clean LF and CRLF, but no FF; was the latter intentional? In any case, we should double-check the generated test output to see if there's anything unexpected. src/jdk.compiler/share/classes/com/sun/tools/javac/parser/DocCommentParser.java line 215: > 213: case '\n', '\r' -> { > 214: return newString(bp, p); > 215: } Hm... this does not seem to be consistent with `newline` in `nextChar`; should it be consistent? src/jdk.compiler/share/classes/com/sun/tools/javac/parser/DocCommentParser.java line 241: > 239: *
  • {@code PREAMBLE}: the appearance of {@code } (or {@code
    }), > 240: * as determined by {@link #isEndPreamble()} > 241: *
  • {@code BODY}: the beginning of a block tag, or when readung from Suggestion: *
  • {@code BODY}: the beginning of a block tag, or when reading from src/jdk.compiler/share/classes/com/sun/tools/javac/parser/DocCommentParser.java line 249: > 247: * > 248: * > 249: * Suggestion: src/jdk.compiler/share/classes/com/sun/tools/javac/parser/DocCommentParser.java line 1000: > 998: *
  • cdata: {@code } > 999: * > 1000: * or Dangling "or". src/jdk.compiler/share/classes/com/sun/tools/javac/parser/JavaTokenizer.java line 1065: > 1063: > 1064: if (accept('/')) { // (Spec. 3.7) > 1065: if (accept('/')) { // Markdown comment I believe that some of the changes in `com/sun/tools/javac/parser` were contributed by @JimLaskey. If so, don't forget to add him as a co-author: `/contributor add jlaskey`. ------------- PR Review: https://git.openjdk.org/jdk/pull/16388#pullrequestreview-1818383901 PR Review Comment: https://git.openjdk.org/jdk/pull/16388#discussion_r1451611443 PR Review Comment: https://git.openjdk.org/jdk/pull/16388#discussion_r1450636952 PR Review Comment: https://git.openjdk.org/jdk/pull/16388#discussion_r1452278438 PR Review Comment: https://git.openjdk.org/jdk/pull/16388#discussion_r1450595553 PR Review Comment: https://git.openjdk.org/jdk/pull/16388#discussion_r1450524385 PR Review Comment: https://git.openjdk.org/jdk/pull/16388#discussion_r1450644783 PR Review Comment: https://git.openjdk.org/jdk/pull/16388#discussion_r1450706952 PR Review Comment: https://git.openjdk.org/jdk/pull/16388#discussion_r1450697324 PR Review Comment: https://git.openjdk.org/jdk/pull/16388#discussion_r1450708532 PR Review Comment: https://git.openjdk.org/jdk/pull/16388#discussion_r1450712757 PR Review Comment: https://git.openjdk.org/jdk/pull/16388#discussion_r1450721951 PR Review Comment: https://git.openjdk.org/jdk/pull/16388#discussion_r1450716256 PR Review Comment: https://git.openjdk.org/jdk/pull/16388#discussion_r1450724201 PR Review Comment: https://git.openjdk.org/jdk/pull/16388#discussion_r1450753241 PR Review Comment: https://git.openjdk.org/jdk/pull/16388#discussion_r1450756727 PR Review Comment: https://git.openjdk.org/jdk/pull/16388#discussion_r1450759909 PR Review Comment: https://git.openjdk.org/jdk/pull/16388#discussion_r1452387246 PR Review Comment: https://git.openjdk.org/jdk/pull/16388#discussion_r1452310521 PR Review Comment: https://git.openjdk.org/jdk/pull/16388#discussion_r1452316008 PR Review Comment: https://git.openjdk.org/jdk/pull/16388#discussion_r1452319517 PR Review Comment: https://git.openjdk.org/jdk/pull/16388#discussion_r1452329926 PR Review Comment: https://git.openjdk.org/jdk/pull/16388#discussion_r1452327712 PR Review Comment: https://git.openjdk.org/jdk/pull/16388#discussion_r1452322576 PR Review Comment: https://git.openjdk.org/jdk/pull/16388#discussion_r1450780454 From shade at openjdk.org Mon Jan 15 16:13:34 2024 From: shade at openjdk.org (Aleksey Shipilev) Date: Mon, 15 Jan 2024 16:13:34 GMT Subject: RFR: 8323515: Create test alias "all" for all test roots Message-ID: Since recent work to improve `tier4` performance, we actually test `tier{1,2,3,4}` often, which includes all the tests in current tree. It would be more convenient to just have the `all` test group/alias, so that we can do `make test TEST=all`. This also gives a parallelism / run time benefit, as we do not wait for tests in each tier to complete before moving to next tier. Sample run on out-of-the-box Linux x86_64 fastdebug is below. For some environments one also needs to supply a few keywords like `!printer` to skip tests that cannot complete without failure due to misconfiguration. I left the keywords as is to show how would a failing run look. There is also an existing shortcut in build system that allows to run this with `make test-all`. % make test TEST=all Test selection 'all', will run: * jtreg:test/hotspot/jtreg:all * jtreg:test/jdk:all * jtreg:test/langtools:all * jtreg:test/jaxp:all * jtreg:test/lib-test:all (...about 6 hours later...) ============================== Test summary ============================== TEST TOTAL PASS FAIL ERROR >> jtreg:test/hotspot/jtreg:all 6731 6702 29 0 << >> jtreg:test/jdk:all 9962 9951 11 0 << jtreg:test/langtools:all 4469 4469 0 0 jtreg:test/jaxp:all 513 513 0 0 jtreg:test/lib-test:all 32 32 0 0 ============================== TEST FAILURE ------------- Commit messages: - Fix Changes: https://git.openjdk.org/jdk/pull/17422/files Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=17422&range=00 Issue: https://bugs.openjdk.org/browse/JDK-8323515 Stats: 41 lines in 5 files changed: 34 ins; 5 del; 2 mod Patch: https://git.openjdk.org/jdk/pull/17422.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/17422/head:pull/17422 PR: https://git.openjdk.org/jdk/pull/17422 From dholmes at openjdk.org Mon Jan 15 22:41:24 2024 From: dholmes at openjdk.org (David Holmes) Date: Mon, 15 Jan 2024 22:41:24 GMT Subject: RFR: 8323515: Create test alias "all" for all test roots In-Reply-To: References: Message-ID: On Mon, 15 Jan 2024 11:05:09 GMT, Aleksey Shipilev wrote: > Since recent work to improve `tier4` performance, we actually test `tier{1,2,3,4}` often, which includes all the tests in current tree. It would be more convenient to just have the `all` test group/alias, so that we can do `make test TEST=all`. This also gives a parallelism / run time benefit, as we do not wait for tests in each tier to complete before moving to next tier. > > Sample run on out-of-the-box Linux x86_64 fastdebug is below. For some environments one also needs to supply a few keywords like `!printer` to skip tests that cannot complete without failure due to misconfiguration. I left the keywords as is to show how would a failing run look. There is also an existing shortcut in build system that allows to run this with `make test-all`. > > > % make test TEST=all > > Test selection 'all', will run: > * jtreg:test/hotspot/jtreg:all > * jtreg:test/jdk:all > * jtreg:test/langtools:all > * jtreg:test/jaxp:all > * jtreg:test/lib-test:all > > (...about 6 hours later...) > > ============================== > Test summary > ============================== > TEST TOTAL PASS FAIL ERROR >>> jtreg:test/hotspot/jtreg:all 6731 6702 29 0 << >>> jtreg:test/jdk:all 9962 9951 11 0 << > jtreg:test/langtools:all 4469 4469 0 0 > jtreg:test/jaxp:all 513 513 0 0 > jtreg:test/lib-test:all 32 32 0 0 > ============================== > TEST FAILURE Okay - change is harmless with no ongoing maintenance cost. test/jdk/TEST.groups line 28: > 26: # > 27: > 28: all = \ Why no `jdk_all` definition in this case? ------------- Marked as reviewed by dholmes (Reviewer). PR Review: https://git.openjdk.org/jdk/pull/17422#pullrequestreview-1822313872 PR Review Comment: https://git.openjdk.org/jdk/pull/17422#discussion_r1452781088 From shade at openjdk.org Tue Jan 16 08:54:46 2024 From: shade at openjdk.org (Aleksey Shipilev) Date: Tue, 16 Jan 2024 08:54:46 GMT Subject: RFR: 8323515: Create test alias "all" for all test roots [v2] In-Reply-To: References: Message-ID: > Since recent work to improve `tier4` performance, we actually test `tier{1,2,3,4}` often, which includes all the tests in current tree. It would be more convenient to just have the `all` test group/alias, so that we can do `make test TEST=all`. This also gives a parallelism / run time benefit, as we do not wait for tests in each tier to complete before moving to next tier. > > Sample run on out-of-the-box Linux x86_64 fastdebug is below. For some environments one also needs to supply a few keywords like `!printer` to skip tests that cannot complete without failure due to misconfiguration. I left the keywords as is to show how would a failing run look. There is also an existing shortcut in build system that allows to run this with `make test-all`. > > > % make test TEST=all > > Test selection 'all', will run: > * jtreg:test/hotspot/jtreg:all > * jtreg:test/jdk:all > * jtreg:test/langtools:all > * jtreg:test/jaxp:all > * jtreg:test/lib-test:all > > (...about 6 hours later...) > > ============================== > Test summary > ============================== > TEST TOTAL PASS FAIL ERROR >>> jtreg:test/hotspot/jtreg:all 6731 6702 29 0 << >>> jtreg:test/jdk:all 9962 9951 11 0 << > jtreg:test/langtools:all 4469 4469 0 0 > jtreg:test/jaxp:all 513 513 0 0 > jtreg:test/lib-test:all 32 32 0 0 > ============================== > TEST FAILURE Aleksey Shipilev has updated the pull request incrementally with one additional commit since the last revision: jdk_all and lib_test_all groups ------------- Changes: - all: https://git.openjdk.org/jdk/pull/17422/files - new: https://git.openjdk.org/jdk/pull/17422/files/7f6797b6..78f5f9bd Webrevs: - full: https://webrevs.openjdk.org/?repo=jdk&pr=17422&range=01 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=17422&range=00-01 Stats: 8 lines in 2 files changed: 8 ins; 0 del; 0 mod Patch: https://git.openjdk.org/jdk/pull/17422.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/17422/head:pull/17422 PR: https://git.openjdk.org/jdk/pull/17422 From shade at openjdk.org Tue Jan 16 08:54:49 2024 From: shade at openjdk.org (Aleksey Shipilev) Date: Tue, 16 Jan 2024 08:54:49 GMT Subject: RFR: 8323515: Create test alias "all" for all test roots [v2] In-Reply-To: References: Message-ID: On Mon, 15 Jan 2024 22:37:36 GMT, David Holmes wrote: >> Aleksey Shipilev has updated the pull request incrementally with one additional commit since the last revision: >> >> jdk_all and lib_test_all groups > > test/jdk/TEST.groups line 28: > >> 26: # >> 27: >> 28: all = \ > > Why no `jdk_all` definition in this case? Tried not to introduce new `*_all` groups here. `jdk_all` would be the same as `jdk:all`, TBH. But we still can do it for symmetry reasons, see new commit. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/17422#discussion_r1453098855 From alanb at openjdk.org Tue Jan 16 08:54:49 2024 From: alanb at openjdk.org (Alan Bateman) Date: Tue, 16 Jan 2024 08:54:49 GMT Subject: RFR: 8323515: Create test alias "all" for all test roots [v2] In-Reply-To: References: Message-ID: On Tue, 16 Jan 2024 08:47:38 GMT, Aleksey Shipilev wrote: >> test/jdk/TEST.groups line 28: >> >>> 26: # >>> 27: >>> 28: all = \ >> >> Why no `jdk_all` definition in this case? > > Tried not to introduce new `*_all` groups here. `jdk_all` would be the same as `jdk:all`, TBH. But we still can do it for symmetry reasons, see new commit. "all" looks okay but the comment "Catch-all" suggests something else, shouldn't be "All tests"? ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/17422#discussion_r1453103766 From shade at openjdk.org Tue Jan 16 09:01:35 2024 From: shade at openjdk.org (Aleksey Shipilev) Date: Tue, 16 Jan 2024 09:01:35 GMT Subject: RFR: 8323515: Create test alias "all" for all test roots [v3] In-Reply-To: References: Message-ID: <9g7evWB6t3A8WAugPwgIP1gyisNBd1pGT9yFoC_0Z8M=.95b0574e-d163-4911-9c79-b58bf7301f7a@github.com> > Since recent work to improve `tier4` performance, we actually test `tier{1,2,3,4}` often, which includes all the tests in current tree. It would be more convenient to just have the `all` test group/alias, so that we can do `make test TEST=all`. This also gives a parallelism / run time benefit, as we do not wait for tests in each tier to complete before moving to next tier. > > Sample run on out-of-the-box Linux x86_64 fastdebug is below. For some environments one also needs to supply a few keywords like `!printer` to skip tests that cannot complete without failure due to misconfiguration. I left the keywords as is to show how would a failing run look. There is also an existing shortcut in build system that allows to run this with `make test-all`. > > > % make test TEST=all > > Test selection 'all', will run: > * jtreg:test/hotspot/jtreg:all > * jtreg:test/jdk:all > * jtreg:test/langtools:all > * jtreg:test/jaxp:all > * jtreg:test/lib-test:all > > (...about 6 hours later...) > > ============================== > Test summary > ============================== > TEST TOTAL PASS FAIL ERROR >>> jtreg:test/hotspot/jtreg:all 6731 6702 29 0 << >>> jtreg:test/jdk:all 9962 9951 11 0 << > jtreg:test/langtools:all 4469 4469 0 0 > jtreg:test/jaxp:all 513 513 0 0 > jtreg:test/lib-test:all 32 32 0 0 > ============================== > TEST FAILURE Aleksey Shipilev has updated the pull request incrementally with one additional commit since the last revision: Catch-all -> All tests ------------- Changes: - all: https://git.openjdk.org/jdk/pull/17422/files - new: https://git.openjdk.org/jdk/pull/17422/files/78f5f9bd..def2f39b Webrevs: - full: https://webrevs.openjdk.org/?repo=jdk&pr=17422&range=02 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=17422&range=01-02 Stats: 5 lines in 5 files changed: 0 ins; 0 del; 5 mod Patch: https://git.openjdk.org/jdk/pull/17422.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/17422/head:pull/17422 PR: https://git.openjdk.org/jdk/pull/17422 From shade at openjdk.org Tue Jan 16 09:01:36 2024 From: shade at openjdk.org (Aleksey Shipilev) Date: Tue, 16 Jan 2024 09:01:36 GMT Subject: RFR: 8323515: Create test alias "all" for all test roots [v3] In-Reply-To: References: Message-ID: On Tue, 16 Jan 2024 08:52:03 GMT, Alan Bateman wrote: >> Tried not to introduce new `*_all` groups here. `jdk_all` would be the same as `jdk:all`, TBH. But we still can do it for symmetry reasons, see new commit. > > "all" looks okay but the comment "Catch-all" suggests something else, shouldn't be "All tests"? Yeah, we can do "All tests" instead. See new commit. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/17422#discussion_r1453113607 From alanb at openjdk.org Tue Jan 16 09:39:19 2024 From: alanb at openjdk.org (Alan Bateman) Date: Tue, 16 Jan 2024 09:39:19 GMT Subject: RFR: 8323515: Create test alias "all" for all test roots [v3] In-Reply-To: <9g7evWB6t3A8WAugPwgIP1gyisNBd1pGT9yFoC_0Z8M=.95b0574e-d163-4911-9c79-b58bf7301f7a@github.com> References: <9g7evWB6t3A8WAugPwgIP1gyisNBd1pGT9yFoC_0Z8M=.95b0574e-d163-4911-9c79-b58bf7301f7a@github.com> Message-ID: On Tue, 16 Jan 2024 09:01:35 GMT, Aleksey Shipilev wrote: >> Since recent work to improve `tier4` performance, we actually test `tier{1,2,3,4}` often, which includes all the tests in current tree. It would be more convenient to just have the `all` test group/alias, so that we can do `make test TEST=all`. This also gives a parallelism / run time benefit, as we do not wait for tests in each tier to complete before moving to next tier. >> >> Sample run on out-of-the-box Linux x86_64 fastdebug is below. For some environments one also needs to supply a few keywords like `!printer` to skip tests that cannot complete without failure due to misconfiguration. I left the keywords as is to show how would a failing run look. There is also an existing shortcut in build system that allows to run this with `make test-all`. >> >> >> % make test TEST=all >> >> Test selection 'all', will run: >> * jtreg:test/hotspot/jtreg:all >> * jtreg:test/jdk:all >> * jtreg:test/langtools:all >> * jtreg:test/jaxp:all >> * jtreg:test/lib-test:all >> >> (...about 6 hours later...) >> >> ============================== >> Test summary >> ============================== >> TEST TOTAL PASS FAIL ERROR >>>> jtreg:test/hotspot/jtreg:all 6731 6702 29 0 << >>>> jtreg:test/jdk:all 9962 9951 11 0 << >> jtreg:test/langtools:all 4469 4469 0 0 >> jtreg:test/jaxp:all 513 513 0 0 >> jtreg:test/lib-test:all 32 32 0 0 >> ============================== >> TEST FAILURE > > Aleksey Shipilev has updated the pull request incrementally with one additional commit since the last revision: > > Catch-all -> All tests Marked as reviewed by alanb (Reviewer). ------------- PR Review: https://git.openjdk.org/jdk/pull/17422#pullrequestreview-1822902993 From ayang at openjdk.org Tue Jan 16 10:06:24 2024 From: ayang at openjdk.org (Albert Mingkun Yang) Date: Tue, 16 Jan 2024 10:06:24 GMT Subject: [jdk22] RFR: 8322330: JavadocHelperTest.java OOMEs with Parallel GC and ZGC In-Reply-To: References: Message-ID: <4-Tjk5uDuLNswWZ9eMu1fYiJkqyVnizGB6HRm1Egs18=.fc302351-36f5-4d85-a486-65032336ca16@github.com> On Tue, 9 Jan 2024 13:58:26 GMT, Thomas Schatzl wrote: > Hi all, > > This pull request contains a backport of commit [52c7ff1d](https://github.com/openjdk/jdk/commit/52c7ff1d81940d6d0d1e3dd7ad0447c80708161c) from the [openjdk/jdk](https://git.openjdk.org/jdk) repository. > > The commit being backported was authored by Thomas Schatzl on 9 Jan 2024 and was reviewed by Albert Mingkun Yang and Axel Boldt-Christmas. > > This is a clean backport. > > Thanks! > Thomas Marked as reviewed by ayang (Reviewer). ------------- PR Review: https://git.openjdk.org/jdk22/pull/44#pullrequestreview-1822961062 From sjohanss at openjdk.org Tue Jan 16 11:01:23 2024 From: sjohanss at openjdk.org (Stefan Johansson) Date: Tue, 16 Jan 2024 11:01:23 GMT Subject: [jdk22] RFR: 8322330: JavadocHelperTest.java OOMEs with Parallel GC and ZGC In-Reply-To: References: Message-ID: On Tue, 9 Jan 2024 13:58:26 GMT, Thomas Schatzl wrote: > Hi all, > > This pull request contains a backport of commit [52c7ff1d](https://github.com/openjdk/jdk/commit/52c7ff1d81940d6d0d1e3dd7ad0447c80708161c) from the [openjdk/jdk](https://git.openjdk.org/jdk) repository. > > The commit being backported was authored by Thomas Schatzl on 9 Jan 2024 and was reviewed by Albert Mingkun Yang and Axel Boldt-Christmas. > > This is a clean backport. > > Thanks! > Thomas Marked as reviewed by sjohanss (Reviewer). ------------- PR Review: https://git.openjdk.org/jdk22/pull/44#pullrequestreview-1823066466 From tschatzl at openjdk.org Tue Jan 16 11:37:21 2024 From: tschatzl at openjdk.org (Thomas Schatzl) Date: Tue, 16 Jan 2024 11:37:21 GMT Subject: [jdk22] RFR: 8322330: JavadocHelperTest.java OOMEs with Parallel GC and ZGC In-Reply-To: References: Message-ID: On Tue, 16 Jan 2024 10:58:21 GMT, Stefan Johansson wrote: >> Hi all, >> >> This pull request contains a backport of commit [52c7ff1d](https://github.com/openjdk/jdk/commit/52c7ff1d81940d6d0d1e3dd7ad0447c80708161c) from the [openjdk/jdk](https://git.openjdk.org/jdk) repository. >> >> The commit being backported was authored by Thomas Schatzl on 9 Jan 2024 and was reviewed by Albert Mingkun Yang and Axel Boldt-Christmas. >> >> This is a clean backport. >> >> Thanks! >> Thomas > > Marked as reviewed by sjohanss (Reviewer). Thanks @kstefanj @albertnetymk for your reviews ------------- PR Comment: https://git.openjdk.org/jdk22/pull/44#issuecomment-1893563887 From tschatzl at openjdk.org Tue Jan 16 11:37:22 2024 From: tschatzl at openjdk.org (Thomas Schatzl) Date: Tue, 16 Jan 2024 11:37:22 GMT Subject: [jdk22] Integrated: 8322330: JavadocHelperTest.java OOMEs with Parallel GC and ZGC In-Reply-To: References: Message-ID: On Tue, 9 Jan 2024 13:58:26 GMT, Thomas Schatzl wrote: > Hi all, > > This pull request contains a backport of commit [52c7ff1d](https://github.com/openjdk/jdk/commit/52c7ff1d81940d6d0d1e3dd7ad0447c80708161c) from the [openjdk/jdk](https://git.openjdk.org/jdk) repository. > > The commit being backported was authored by Thomas Schatzl on 9 Jan 2024 and was reviewed by Albert Mingkun Yang and Axel Boldt-Christmas. > > This is a clean backport. > > Thanks! > Thomas This pull request has now been integrated. Changeset: bb43aae6 Author: Thomas Schatzl URL: https://git.openjdk.org/jdk22/commit/bb43aae61fefea1e50f619f5a81d3242e13b04e9 Stats: 1 line in 1 file changed: 0 ins; 0 del; 1 mod 8322330: JavadocHelperTest.java OOMEs with Parallel GC and ZGC Reviewed-by: ayang, sjohanss Backport-of: 52c7ff1d81940d6d0d1e3dd7ad0447c80708161c ------------- PR: https://git.openjdk.org/jdk22/pull/44 From darcy at openjdk.org Tue Jan 16 20:50:25 2024 From: darcy at openjdk.org (Joe Darcy) Date: Tue, 16 Jan 2024 20:50:25 GMT Subject: RFR: JDK-8323684: TypeMirror.{getAnnotationsByType, getAnnotation} return uninformative results Message-ID: Initial implementation to make TypeMirror.{getAnnotationsByType, getAnnotation} functional; tests to follow. ------------- Commit messages: - Appease jcheck. - Add regression tests. - JDK-8323684: TypeMirror.{getAnnotationsByType, getAnnotation} return uninformative results Changes: https://git.openjdk.org/jdk/pull/17410/files Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=17410&range=00 Issue: https://bugs.openjdk.org/browse/JDK-8323684 Stats: 155 lines in 4 files changed: 129 ins; 18 del; 8 mod Patch: https://git.openjdk.org/jdk/pull/17410.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/17410/head:pull/17410 PR: https://git.openjdk.org/jdk/pull/17410 From darcy at openjdk.org Tue Jan 16 20:50:25 2024 From: darcy at openjdk.org (Joe Darcy) Date: Tue, 16 Jan 2024 20:50:25 GMT Subject: RFR: JDK-8323684: TypeMirror.{getAnnotationsByType, getAnnotation} return uninformative results In-Reply-To: References: Message-ID: On Fri, 12 Jan 2024 22:29:30 GMT, Joe Darcy wrote: > Initial implementation to make TypeMirror.{getAnnotationsByType, getAnnotation} functional; tests to follow. > Initial implementation to make TypeMirror.{getAnnotationsByType, getAnnotation} functional; tests to follow. > ### Progress > > * [ ] Change must be properly reviewed (1 review required, with at least 1 [Reviewer](https://openjdk.org/bylaws#reviewer)) > > * [x] Change must not contain extraneous whitespace > > * [x] Commit message must refer to an issue > > > ### Issue > > * [JDK-8323684](https://bugs.openjdk.org/browse/JDK-8323684): TypeMirror.{getAnnotationsByType, getAnnotation} return uninformative results (**Bug** - P4) > > > ### Reviewing > Using `git` > Using Skara CLI tools > Using diff file The regression tests changes as written check both declaration and type annotations. Given that the type annotation code is shared for all kinds of types, the testing on one shape of type should be adequate from a regression testing perspective. ------------- PR Comment: https://git.openjdk.org/jdk/pull/17410#issuecomment-1894486674 From darcy at openjdk.org Tue Jan 16 21:03:54 2024 From: darcy at openjdk.org (Joe Darcy) Date: Tue, 16 Jan 2024 21:03:54 GMT Subject: RFR: JDK-8323684: TypeMirror.{getAnnotationsByType, getAnnotation} return uninformative results In-Reply-To: References: Message-ID: On Fri, 12 Jan 2024 22:29:30 GMT, Joe Darcy wrote: > Initial implementation to make TypeMirror.{getAnnotationsByType, getAnnotation} functional; tests to follow. CSR up for review: https://bugs.openjdk.org/browse/JDK-8323837 ------------- PR Comment: https://git.openjdk.org/jdk/pull/17410#issuecomment-1894505040 From darcy at openjdk.org Tue Jan 16 22:01:58 2024 From: darcy at openjdk.org (Joe Darcy) Date: Tue, 16 Jan 2024 22:01:58 GMT Subject: RFR: JDK-8323839: Expand use of Messager convenience methods in langtools regression tests Message-ID: Simple refactoring. Remaining uses of "printMessage" are against Trees (where there are no corresponding convenience methods) or for calls to printMessage where there is not an appropriate convenience method overload, etc. ------------- Commit messages: - JDK-8323839: Expand use of Messager convenience methods in langtools regression tests Changes: https://git.openjdk.org/jdk/pull/17454/files Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=17454&range=00 Issue: https://bugs.openjdk.org/browse/JDK-8323839 Stats: 9 lines in 5 files changed: 0 ins; 0 del; 9 mod Patch: https://git.openjdk.org/jdk/pull/17454.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/17454/head:pull/17454 PR: https://git.openjdk.org/jdk/pull/17454 From jjg at openjdk.org Tue Jan 16 22:08:51 2024 From: jjg at openjdk.org (Jonathan Gibbons) Date: Tue, 16 Jan 2024 22:08:51 GMT Subject: RFR: JDK-8323839: Expand use of Messager convenience methods in langtools regression tests In-Reply-To: References: Message-ID: On Tue, 16 Jan 2024 21:53:27 GMT, Joe Darcy wrote: > Simple refactoring. Remaining uses of "printMessage" are against Trees (where there are no corresponding convenience methods) or for calls to printMessage where there is not an appropriate convenience method overload, etc. Marked as reviewed by jjg (Reviewer). ------------- PR Review: https://git.openjdk.org/jdk/pull/17454#pullrequestreview-1825333755 From jjg at openjdk.org Wed Jan 17 00:16:55 2024 From: jjg at openjdk.org (Jonathan Gibbons) Date: Wed, 17 Jan 2024 00:16:55 GMT Subject: RFR: JDK-8298405: Support Markdown in Documentation Comments [v2] In-Reply-To: References: <0xaWRD1add432FW4NF8dhU3gi3q6BzPbhdnSMWKs2CY=.6ed27293-a889-4802-8e3f-e9f5d0a030e2@github.com> Message-ID: On Thu, 11 Jan 2024 15:35:13 GMT, Pavel Rappo wrote: >> Update: >> Markdown in tags defined by the user on the command-line works pretty much as expected: not great, but not bad. >> >> Headings in user-defined tags work, but are semantically questionable, since the tags are generated inside a definition list (which itself is maybe questionable, these days.). There is (currently) no special accommodation for the "virtual heading" in the presentation of the block tag. >> >> Headings, sections, HTML 5, Markdown and taglets are a complicated mess, and probably better discussed and tracked in JBS. > > Understood. FWIW, here are a few examples of headings in user-defined tags in JDK: > > https://github.com/openjdk/jdk/blob/a6785e4d633908596ddb6de6d2eeab1c9ebdf2c3/src/java.base/share/classes/java/math/BigDecimal.java#L229-L239 > > https://github.com/openjdk/jdk/blob/ddbbd36e4b064b9e7433f0a55973d72cd6dbc0d3/src/java.xml/share/classes/module-info.java#L402-L420 > > https://github.com/openjdk/jdk/blob/6f6486e97743eadfb20b4175e1b4b2b05b59a17a/src/jdk.incubator.vector/share/classes/jdk/incubator/vector/Vector.java#L1089-L1093 Thanks for the examples. Stylistically, they are maybe questionable. But we can make sure that something sensible happens, and deal with stylistic issues later. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/16388#discussion_r1454239539 From jjg at openjdk.org Wed Jan 17 00:27:58 2024 From: jjg at openjdk.org (Jonathan Gibbons) Date: Wed, 17 Jan 2024 00:27:58 GMT Subject: RFR: JDK-8298405: Support Markdown in Documentation Comments [v6] In-Reply-To: <6df9dQzBK0M7SlHDpNO4T_bhE7i6WqwLP64cs6Df9A8=.e08f76a3-8753-4bad-9325-b0ab042645a4@github.com> References: <0mlIFIZ2ec8oE2zlmKxoMwp59dBgOdUQs-vzTLnU7hI=.15fa2827-8c87-415b-ab74-0e42b45a5cf7@github.com> <6df9dQzBK0M7SlHDpNO4T_bhE7i6WqwLP64cs6Df9A8=.e08f76a3-8753-4bad-9325-b0ab042645a4@github.com> Message-ID: On Fri, 12 Jan 2024 15:55:43 GMT, Pavel Rappo wrote: >> Jonathan Gibbons 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 seven additional commits since the last revision: >> >> - Merge with upstream/master >> - Merge remote-tracking branch 'upstream/master' into 8298405.doclet-markdown-v3 >> - Address review comments >> - Fix whitespace >> - Improve handling of embedded inline taglets >> - Customize support for Markdown headings >> - JDK-8298405: Support Markdown in Documentation Comments > > src/jdk.compiler/share/classes/com/sun/source/doctree/RawTextTree.java line 40: > >> 38: * @apiNote >> 39: * This class may be used to represent tree nodes containing >> 40: * {@linkplain DocTree.Kind#MARKDOWN Markdown} text. > > This means that there is one-to-many relationship between `RawTextTree` and `DocTree.KIND`. This in turn perpetuates the pattern of checking the kind followed by casting as opposed to more modern `instanceof` pattern matching. There's nothing wrong with it per se, however I wonder what the rationale is for leaving this part of the API open-ended. Is it to support other types of raw text in the future? Yes, the thinking was to allow it to be open-ended. In this case, while I think we should specify the ability to use `instanceof`-style checks with this API, I do not think it would be necessary ... there is no need for a subtype for `MarkdownTree`, nor would I expect there to be one for any other kind of raw text. > src/jdk.compiler/share/classes/com/sun/tools/javac/parser/DocCommentParser.java line 89: > >> 87: POSTAMBLE, >> 88: /** The rich-text content of an inline documentation comment tag. */ >> 89: INLINE > > Do we also need to say something about `.md` files here? Probably, yes. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/16388#discussion_r1454249356 PR Review Comment: https://git.openjdk.org/jdk/pull/16388#discussion_r1454250904 From darcy at openjdk.org Wed Jan 17 00:31:57 2024 From: darcy at openjdk.org (Joe Darcy) Date: Wed, 17 Jan 2024 00:31:57 GMT Subject: Integrated: JDK-8323839: Expand use of Messager convenience methods in langtools regression tests In-Reply-To: References: Message-ID: On Tue, 16 Jan 2024 21:53:27 GMT, Joe Darcy wrote: > Simple refactoring. Remaining uses of "printMessage" are against Trees (where there are no corresponding convenience methods) or for calls to printMessage where there is not an appropriate convenience method overload, etc. This pull request has now been integrated. Changeset: d8b63370 Author: Joe Darcy URL: https://git.openjdk.org/jdk/commit/d8b63370f301e6f2d2a43d997b9372f08dfcd2b4 Stats: 9 lines in 5 files changed: 0 ins; 0 del; 9 mod 8323839: Expand use of Messager convenience methods in langtools regression tests Reviewed-by: jjg ------------- PR: https://git.openjdk.org/jdk/pull/17454 From shade at openjdk.org Wed Jan 17 12:12:52 2024 From: shade at openjdk.org (Aleksey Shipilev) Date: Wed, 17 Jan 2024 12:12:52 GMT Subject: RFR: 8323515: Create test alias "all" for all test roots [v3] In-Reply-To: <9g7evWB6t3A8WAugPwgIP1gyisNBd1pGT9yFoC_0Z8M=.95b0574e-d163-4911-9c79-b58bf7301f7a@github.com> References: <9g7evWB6t3A8WAugPwgIP1gyisNBd1pGT9yFoC_0Z8M=.95b0574e-d163-4911-9c79-b58bf7301f7a@github.com> Message-ID: On Tue, 16 Jan 2024 09:01:35 GMT, Aleksey Shipilev wrote: >> Since recent work to improve `tier4` performance, we actually test `tier{1,2,3,4}` often, which includes all the tests in current tree. It would be more convenient to just have the `all` test group/alias, so that we can do `make test TEST=all`. This also gives a parallelism / run time benefit, as we do not wait for tests in each tier to complete before moving to next tier. >> >> Sample run on out-of-the-box Linux x86_64 fastdebug is below. For some environments one also needs to supply a few keywords like `!printer` to skip tests that cannot complete without failure due to misconfiguration. I left the keywords as is to show how would a failing run look. There is also an existing shortcut in build system that allows to run this with `make test-all`. >> >> >> % make test TEST=all >> >> Test selection 'all', will run: >> * jtreg:test/hotspot/jtreg:all >> * jtreg:test/jdk:all >> * jtreg:test/langtools:all >> * jtreg:test/jaxp:all >> * jtreg:test/lib-test:all >> >> (...about 6 hours later...) >> >> ============================== >> Test summary >> ============================== >> TEST TOTAL PASS FAIL ERROR >>>> jtreg:test/hotspot/jtreg:all 6731 6702 29 0 << >>>> jtreg:test/jdk:all 9962 9951 11 0 << >> jtreg:test/langtools:all 4469 4469 0 0 >> jtreg:test/jaxp:all 513 513 0 0 >> jtreg:test/lib-test:all 32 32 0 0 >> ============================== >> TEST FAILURE > > Aleksey Shipilev has updated the pull request incrementally with one additional commit since the last revision: > > Catch-all -> All tests Any other reviews needed for this? Nominally, this changes the test groups in langtools, so maybe @lahodaj or @biboudis want to take a look. For jaxp, @JoeWang-Java, maybe? ------------- PR Comment: https://git.openjdk.org/jdk/pull/17422#issuecomment-1895680732 From abimpoudis at openjdk.org Wed Jan 17 15:55:43 2024 From: abimpoudis at openjdk.org (Aggelos Biboudis) Date: Wed, 17 Jan 2024 15:55:43 GMT Subject: RFR: 8323502: javac crash with wrongly typed method block in Flow Message-ID: The observation is that the `tree.target` of the RHS's `yield` was not set properly to point at the outer switch. As a result, the assertion was hit in `clearPendingExits` with a wrong set of pending exits. The cause was that the `tree` was not attributed since `visitSwitchExpression` was short-circuited to `return;` and `visitYield` was never setting the `target`. As a result, `resolveJump` was not actually resolving the jump correctly. thx @lahodaj for the help! ------------- Commit messages: - 8323502: javac crash with wrongly typed method block in Flow Changes: https://git.openjdk.org/jdk/pull/17466/files Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=17466&range=00 Issue: https://bugs.openjdk.org/browse/JDK-8323502 Stats: 42 lines in 3 files changed: 39 ins; 0 del; 3 mod Patch: https://git.openjdk.org/jdk/pull/17466.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/17466/head:pull/17466 PR: https://git.openjdk.org/jdk/pull/17466 From joehw at openjdk.org Wed Jan 17 17:41:52 2024 From: joehw at openjdk.org (Joe Wang) Date: Wed, 17 Jan 2024 17:41:52 GMT Subject: RFR: 8323515: Create test alias "all" for all test roots [v3] In-Reply-To: <9g7evWB6t3A8WAugPwgIP1gyisNBd1pGT9yFoC_0Z8M=.95b0574e-d163-4911-9c79-b58bf7301f7a@github.com> References: <9g7evWB6t3A8WAugPwgIP1gyisNBd1pGT9yFoC_0Z8M=.95b0574e-d163-4911-9c79-b58bf7301f7a@github.com> Message-ID: On Tue, 16 Jan 2024 09:01:35 GMT, Aleksey Shipilev wrote: >> Since recent work to improve `tier4` performance, we actually test `tier{1,2,3,4}` often, which includes all the tests in current tree. It would be more convenient to just have the `all` test group/alias, so that we can do `make test TEST=all`. This also gives a parallelism / run time benefit, as we do not wait for tests in each tier to complete before moving to next tier. >> >> Sample run on out-of-the-box Linux x86_64 fastdebug is below. For some environments one also needs to supply a few keywords like `!printer` to skip tests that cannot complete without failure due to misconfiguration. I left the keywords as is to show how would a failing run look. There is also an existing shortcut in build system that allows to run this with `make test-all`. >> >> >> % make test TEST=all >> >> Test selection 'all', will run: >> * jtreg:test/hotspot/jtreg:all >> * jtreg:test/jdk:all >> * jtreg:test/langtools:all >> * jtreg:test/jaxp:all >> * jtreg:test/lib-test:all >> >> (...about 6 hours later...) >> >> ============================== >> Test summary >> ============================== >> TEST TOTAL PASS FAIL ERROR >>>> jtreg:test/hotspot/jtreg:all 6731 6702 29 0 << >>>> jtreg:test/jdk:all 9962 9951 11 0 << >> jtreg:test/langtools:all 4469 4469 0 0 >> jtreg:test/jaxp:all 513 513 0 0 >> jtreg:test/lib-test:all 32 32 0 0 >> ============================== >> TEST FAILURE > > Aleksey Shipilev has updated the pull request incrementally with one additional commit since the last revision: > > Catch-all -> All tests Thanks for the reminder. The new alias is nice, easier to run all tier tests. I often run xml-only as well that includes jaxp_all plus a small set of jaxp tests in jdk_all (test/jdk/javax/xml/jaxp). But that's just me, jdk_all already covers those tests. ------------- Marked as reviewed by joehw (Reviewer). PR Review: https://git.openjdk.org/jdk/pull/17422#pullrequestreview-1827838226 From darcy at openjdk.org Thu Jan 18 00:13:22 2024 From: darcy at openjdk.org (Joe Darcy) Date: Thu, 18 Jan 2024 00:13:22 GMT Subject: RFR: JDK-8323684: TypeMirror.{getAnnotationsByType, getAnnotation} return uninformative results [v2] In-Reply-To: References: Message-ID: > Initial implementation to make TypeMirror.{getAnnotationsByType, getAnnotation} functional; tests to follow. Joe Darcy 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 four additional commits since the last revision: - Merge branch 'master' into JDK-8323684 - Appease jcheck. - Add regression tests. - JDK-8323684: TypeMirror.{getAnnotationsByType, getAnnotation} return uninformative results ------------- Changes: - all: https://git.openjdk.org/jdk/pull/17410/files - new: https://git.openjdk.org/jdk/pull/17410/files/284fea38..37711749 Webrevs: - full: https://webrevs.openjdk.org/?repo=jdk&pr=17410&range=01 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=17410&range=00-01 Stats: 6778 lines in 149 files changed: 2586 ins; 3769 del; 423 mod Patch: https://git.openjdk.org/jdk/pull/17410.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/17410/head:pull/17410 PR: https://git.openjdk.org/jdk/pull/17410 From jjg at openjdk.org Thu Jan 18 00:13:25 2024 From: jjg at openjdk.org (Jonathan Gibbons) Date: Thu, 18 Jan 2024 00:13:25 GMT Subject: RFR: JDK-8323684: TypeMirror.{getAnnotationsByType, getAnnotation} return uninformative results [v2] In-Reply-To: References: Message-ID: On Thu, 18 Jan 2024 00:09:47 GMT, Joe Darcy wrote: >> Initial implementation to make TypeMirror.{getAnnotationsByType, getAnnotation} functional; tests to follow. > > Joe Darcy 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 four additional commits since the last revision: > > - Merge branch 'master' into JDK-8323684 > - Appease jcheck. > - Add regression tests. > - JDK-8323684: TypeMirror.{getAnnotationsByType, getAnnotation} return uninformative results test/langtools/tools/javac/processing/model/type/BasicAnnoTests.java line 92: > 90: PrintWriter out; > 91: boolean verbose = true; > 92: static Map> nameToAnnotation; this looks questionable ... a mutable static field test/langtools/tools/javac/processing/model/type/BasicAnnoTests.java line 115: > 113: new NameToAnnotationEntry("BasicAnnoTests.TB", BasicAnnoTests.TB.class), > 114: new NameToAnnotationEntry("BasicAnnoTests.TC", BasicAnnoTests.TC.class), > 115: new NameToAnnotationEntry("BasicAnnoTests.TCs", BasicAnnoTests.TCs.class)); You could maybe simplify this by obtaining the name from the class parameter. test/langtools/tools/javac/processing/model/type/BasicAnnoTests.java line 318: > 316: /** > 317: * Verify that an annotation mirror returned by > 318: * getAnnotatinMirrors() has a matching annotation from spelling typo: getAnnotatinMirrors ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/17410#discussion_r1456639799 PR Review Comment: https://git.openjdk.org/jdk/pull/17410#discussion_r1456644682 PR Review Comment: https://git.openjdk.org/jdk/pull/17410#discussion_r1456640756 From darcy at openjdk.org Thu Jan 18 00:13:26 2024 From: darcy at openjdk.org (Joe Darcy) Date: Thu, 18 Jan 2024 00:13:26 GMT Subject: RFR: JDK-8323684: TypeMirror.{getAnnotationsByType, getAnnotation} return uninformative results [v2] In-Reply-To: References: Message-ID: On Thu, 18 Jan 2024 00:01:28 GMT, Jonathan Gibbons wrote: >> Joe Darcy 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 four additional commits since the last revision: >> >> - Merge branch 'master' into JDK-8323684 >> - Appease jcheck. >> - Add regression tests. >> - JDK-8323684: TypeMirror.{getAnnotationsByType, getAnnotation} return uninformative results > > test/langtools/tools/javac/processing/model/type/BasicAnnoTests.java line 92: > >> 90: PrintWriter out; >> 91: boolean verbose = true; >> 92: static Map> nameToAnnotation; > > this looks questionable ... a mutable static field Good point -- the mapping should be static given the method it is used in are static; I'll change to a static final. Thanks. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/17410#discussion_r1456641403 From jjg at openjdk.org Thu Jan 18 00:13:27 2024 From: jjg at openjdk.org (Jonathan Gibbons) Date: Thu, 18 Jan 2024 00:13:27 GMT Subject: RFR: JDK-8323684: TypeMirror.{getAnnotationsByType, getAnnotation} return uninformative results [v2] In-Reply-To: References: Message-ID: On Thu, 18 Jan 2024 00:03:59 GMT, Joe Darcy wrote: >> test/langtools/tools/javac/processing/model/type/BasicAnnoTests.java line 92: >> >>> 90: PrintWriter out; >>> 91: boolean verbose = true; >>> 92: static Map> nameToAnnotation; >> >> this looks questionable ... a mutable static field > > Good point -- the mapping should be static given the method it is used in are static; I'll change to a static final. Thanks. is it possible to make this static final with an initializer? ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/17410#discussion_r1456643600 From darcy at openjdk.org Thu Jan 18 00:34:21 2024 From: darcy at openjdk.org (Joe Darcy) Date: Thu, 18 Jan 2024 00:34:21 GMT Subject: RFR: JDK-8323684: TypeMirror.{getAnnotationsByType, getAnnotation} return uninformative results [v3] In-Reply-To: References: Message-ID: <1cQBV_wn68b5NA_eCsBvI8gsK6gP8OcnKDpMHubwGgk=.70b8d284-8675-448f-98d6-10ecda0f1d16@github.com> > Initial implementation to make TypeMirror.{getAnnotationsByType, getAnnotation} functional; tests to follow. Joe Darcy has updated the pull request incrementally with one additional commit since the last revision: Implement review feedback on regression test. ------------- Changes: - all: https://git.openjdk.org/jdk/pull/17410/files - new: https://git.openjdk.org/jdk/pull/17410/files/37711749..9717a54c Webrevs: - full: https://webrevs.openjdk.org/?repo=jdk&pr=17410&range=02 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=17410&range=01-02 Stats: 25 lines in 1 file changed: 10 ins; 11 del; 4 mod Patch: https://git.openjdk.org/jdk/pull/17410.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/17410/head:pull/17410 PR: https://git.openjdk.org/jdk/pull/17410 From darcy at openjdk.org Thu Jan 18 00:34:24 2024 From: darcy at openjdk.org (Joe Darcy) Date: Thu, 18 Jan 2024 00:34:24 GMT Subject: RFR: JDK-8323684: TypeMirror.{getAnnotationsByType, getAnnotation} return uninformative results [v3] In-Reply-To: References: Message-ID: <99zKYcqHIDWkHgxOp2kURAGx4tKdIsraKnPa5yM-m-E=.cfaecdf7-b1ca-45c0-b506-16d369b6db83@github.com> On Thu, 18 Jan 2024 00:09:46 GMT, Jonathan Gibbons wrote: >> Joe Darcy has updated the pull request incrementally with one additional commit since the last revision: >> >> Implement review feedback on regression test. > > test/langtools/tools/javac/processing/model/type/BasicAnnoTests.java line 115: > >> 113: new NameToAnnotationEntry("BasicAnnoTests.TB", BasicAnnoTests.TB.class), >> 114: new NameToAnnotationEntry("BasicAnnoTests.TC", BasicAnnoTests.TC.class), >> 115: new NameToAnnotationEntry("BasicAnnoTests.TCs", BasicAnnoTests.TCs.class)); > > You could maybe simplify this by obtaining the name from the class parameter. Might be a case a premature optimization, but I wanted to avoid the repeated reflective operations here. > test/langtools/tools/javac/processing/model/type/BasicAnnoTests.java line 318: > >> 316: /** >> 317: * Verify that an annotation mirror returned by >> 318: * getAnnotatinMirrors() has a matching annotation from > > spelling typo: getAnnotatinMirrors Fixed; thanks. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/17410#discussion_r1456669422 PR Review Comment: https://git.openjdk.org/jdk/pull/17410#discussion_r1456669060 From darcy at openjdk.org Thu Jan 18 00:55:20 2024 From: darcy at openjdk.org (Joe Darcy) Date: Thu, 18 Jan 2024 00:55:20 GMT Subject: RFR: JDK-8323684: TypeMirror.{getAnnotationsByType, getAnnotation} return uninformative results [v3] In-Reply-To: <1cQBV_wn68b5NA_eCsBvI8gsK6gP8OcnKDpMHubwGgk=.70b8d284-8675-448f-98d6-10ecda0f1d16@github.com> References: <1cQBV_wn68b5NA_eCsBvI8gsK6gP8OcnKDpMHubwGgk=.70b8d284-8675-448f-98d6-10ecda0f1d16@github.com> Message-ID: On Thu, 18 Jan 2024 00:34:21 GMT, Joe Darcy wrote: >> Initial implementation to make TypeMirror.{getAnnotationsByType, getAnnotation} functional; tests to follow. > > Joe Darcy has updated the pull request incrementally with one additional commit since the last revision: > > Implement review feedback on regression test. src/jdk.compiler/share/classes/com/sun/tools/javac/code/AnnoConstruct.java line 53: > 51: * or deletion without notice.

    > 52: */ > 53: public abstract sealed class AnnoConstruct implements AnnotatedConstruct @lahodaj or @vicente-romero-oracle , any thoughts on using sealed/non-sealed in javac in this way? If I don't here back from you on this point, I'll revert use of sealed/non-sealed before pushing. Thanks. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/17410#discussion_r1456684651 From jjg at openjdk.org Thu Jan 18 01:04:15 2024 From: jjg at openjdk.org (Jonathan Gibbons) Date: Thu, 18 Jan 2024 01:04:15 GMT Subject: RFR: JDK-8323684: TypeMirror.{getAnnotationsByType, getAnnotation} return uninformative results [v3] In-Reply-To: <1cQBV_wn68b5NA_eCsBvI8gsK6gP8OcnKDpMHubwGgk=.70b8d284-8675-448f-98d6-10ecda0f1d16@github.com> References: <1cQBV_wn68b5NA_eCsBvI8gsK6gP8OcnKDpMHubwGgk=.70b8d284-8675-448f-98d6-10ecda0f1d16@github.com> Message-ID: On Thu, 18 Jan 2024 00:34:21 GMT, Joe Darcy wrote: >> Initial implementation to make TypeMirror.{getAnnotationsByType, getAnnotation} functional; tests to follow. > > Joe Darcy has updated the pull request incrementally with one additional commit since the last revision: > > Implement review feedback on regression test. Marked as reviewed by jjg (Reviewer). ------------- PR Review: https://git.openjdk.org/jdk/pull/17410#pullrequestreview-1828510208 From jjg at openjdk.org Thu Jan 18 01:04:17 2024 From: jjg at openjdk.org (Jonathan Gibbons) Date: Thu, 18 Jan 2024 01:04:17 GMT Subject: RFR: JDK-8323684: TypeMirror.{getAnnotationsByType, getAnnotation} return uninformative results [v3] In-Reply-To: References: <1cQBV_wn68b5NA_eCsBvI8gsK6gP8OcnKDpMHubwGgk=.70b8d284-8675-448f-98d6-10ecda0f1d16@github.com> Message-ID: On Thu, 18 Jan 2024 00:52:52 GMT, Joe Darcy wrote: >> Joe Darcy has updated the pull request incrementally with one additional commit since the last revision: >> >> Implement review feedback on regression test. > > src/jdk.compiler/share/classes/com/sun/tools/javac/code/AnnoConstruct.java line 53: > >> 51: * or deletion without notice.

    >> 52: */ >> 53: public abstract sealed class AnnoConstruct implements AnnotatedConstruct > > @lahodaj or @vicente-romero-oracle , any thoughts on using sealed/non-sealed in javac in this way? > > If I don't here back from you on this point, I'll revert use of sealed/non-sealed before pushing. Thanks. With my `javadoc` hat on, I would hope that `Element` is never `sealed`. But that's a separate issue. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/17410#discussion_r1456690099 From jjg at openjdk.org Thu Jan 18 01:04:19 2024 From: jjg at openjdk.org (Jonathan Gibbons) Date: Thu, 18 Jan 2024 01:04:19 GMT Subject: RFR: JDK-8323684: TypeMirror.{getAnnotationsByType, getAnnotation} return uninformative results [v3] In-Reply-To: <99zKYcqHIDWkHgxOp2kURAGx4tKdIsraKnPa5yM-m-E=.cfaecdf7-b1ca-45c0-b506-16d369b6db83@github.com> References: <99zKYcqHIDWkHgxOp2kURAGx4tKdIsraKnPa5yM-m-E=.cfaecdf7-b1ca-45c0-b506-16d369b6db83@github.com> Message-ID: <0Haah60uuHjXrJ4q82Du08HBLP9CKiooMqDbxFvMrco=.66f21161-ff62-4bae-affd-068a2b2d4c76@github.com> On Thu, 18 Jan 2024 00:30:32 GMT, Joe Darcy wrote: >> test/langtools/tools/javac/processing/model/type/BasicAnnoTests.java line 115: >> >>> 113: new NameToAnnotationEntry("BasicAnnoTests.TB", BasicAnnoTests.TB.class), >>> 114: new NameToAnnotationEntry("BasicAnnoTests.TC", BasicAnnoTests.TC.class), >>> 115: new NameToAnnotationEntry("BasicAnnoTests.TCs", BasicAnnoTests.TCs.class)); >> >> You could maybe simplify this by obtaining the name from the class parameter. > > Might be a case a premature optimization, but I wanted to avoid the repeated reflective operations here. Yeah, the map isn't bad in itself, I just have a knee-jerk reaction to mutable static fields ;-) ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/17410#discussion_r1456689039 From darcy at openjdk.org Thu Jan 18 01:22:18 2024 From: darcy at openjdk.org (Joe Darcy) Date: Thu, 18 Jan 2024 01:22:18 GMT Subject: RFR: JDK-8323684: TypeMirror.{getAnnotationsByType, getAnnotation} return uninformative results [v3] In-Reply-To: References: <1cQBV_wn68b5NA_eCsBvI8gsK6gP8OcnKDpMHubwGgk=.70b8d284-8675-448f-98d6-10ecda0f1d16@github.com> Message-ID: On Thu, 18 Jan 2024 01:01:38 GMT, Jonathan Gibbons wrote: >> src/jdk.compiler/share/classes/com/sun/tools/javac/code/AnnoConstruct.java line 53: >> >>> 51: * or deletion without notice.

    >>> 52: */ >>> 53: public abstract sealed class AnnoConstruct implements AnnotatedConstruct >> >> @lahodaj or @vicente-romero-oracle , any thoughts on using sealed/non-sealed in javac in this way? >> >> If I don't here back from you on this point, I'll revert use of sealed/non-sealed before pushing. Thanks. > > With my `javadoc` hat on, I would hope that `Element` is never `sealed`. But that's a separate issue. If we had sealed types when JSR 269 was in development, there are at least a few places in the API I would have liked to use them, in particular to seal javax.lang.model.UnknownEntityException to only have in-API subclasses. Given that the javax.lang.model.{element, type} packages were intended to allow multiple independent implementations, the root interfaces like element couldn't be sealed while achieving that goal. Inside javac, Type and Symbol could also be declared to be sealed rather than non-sealed, possibly at the cost of listed out all the subclasses. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/17410#discussion_r1456700924 From jlahoda at openjdk.org Thu Jan 18 11:09:21 2024 From: jlahoda at openjdk.org (Jan Lahoda) Date: Thu, 18 Jan 2024 11:09:21 GMT Subject: RFR: 8323657: Compilation of snippet results in VerifyError at runtime with --release 9 (and above) Message-ID: <8J6pCJK0dp-jErumOx3a8Ht-KdGJassMr4ZV9Th1DTo=.2090fe6d-a51c-41b0-a095-d1bf7c60b6f8@github.com> Consider code like: public class Test { public static void main(String... args) { System.err.println((test() ? null : null) + ""); } private static boolean test() { System.err.println("test called!"); return true; } } This should print: test called! null but it prints: $ java /tmp/Test.java null The correct semantics can be achieved by using `--source 8`: $ java --source 8 /tmp/Test.java test called! null Or `-XDstringConcat=inline` when compiling. The reason is that when `StringConcat.IndyConstants` converts String concatenation parameters, it will short-circuit any expressions whose type is BOT (i.e. basically the `null` type). But, in this case, the expression that has the BOT type is a complex expression with a side-effect, so short-circuiting it leads to a broken semantics. My proposal is to "short-circuit" only `null` literals, and generate other expressions normally. There may be some corner cases where we'd generate the expression unnecessarily (if it does not have any side-effect), but looking for side-effects seems unnecessarily complex and fragile given I'd expect non-trivial expressions with the BOT type are very rare. (The only case which comes to mind is exactly the above one - a conditional expressions, whose both result values are `null`.) Please note that when the expression is incorrectly short-circuited, it may lead to various other effects - the original bug report shows a case where the resulting code does not pass the verification. ------------- Commit messages: - 8323657: Compilation of snippet results in VerifyError at runtime with --release 9 (and above) Changes: https://git.openjdk.org/jdk/pull/17483/files Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=17483&range=00 Issue: https://bugs.openjdk.org/browse/JDK-8323657 Stats: 65 lines in 2 files changed: 64 ins; 0 del; 1 mod Patch: https://git.openjdk.org/jdk/pull/17483.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/17483/head:pull/17483 PR: https://git.openjdk.org/jdk/pull/17483 From asotona at openjdk.org Thu Jan 18 15:06:19 2024 From: asotona at openjdk.org (Adam Sotona) Date: Thu, 18 Jan 2024 15:06:19 GMT Subject: [jdk22] Withdrawn: 8288989: Make tests not depend on the source code In-Reply-To: References: Message-ID: On Thu, 14 Dec 2023 11:50:26 GMT, Adam Sotona wrote: > 8288989: Make tests not depend on the source code This pull request has been closed without being integrated. ------------- PR: https://git.openjdk.org/jdk22/pull/13 From darcy at openjdk.org Thu Jan 18 19:01:32 2024 From: darcy at openjdk.org (Joe Darcy) Date: Thu, 18 Jan 2024 19:01:32 GMT Subject: RFR: JDK-8323684: TypeMirror.{getAnnotationsByType, getAnnotation} return uninformative results [v4] In-Reply-To: References: Message-ID: > Initial implementation to make TypeMirror.{getAnnotationsByType, getAnnotation} functional; tests to follow. Joe Darcy has updated the pull request incrementally with one additional commit since the last revision: Remove sealed/non-sealed changes. ------------- Changes: - all: https://git.openjdk.org/jdk/pull/17410/files - new: https://git.openjdk.org/jdk/pull/17410/files/9717a54c..25f4f150 Webrevs: - full: https://webrevs.openjdk.org/?repo=jdk&pr=17410&range=03 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=17410&range=02-03 Stats: 10 lines in 3 files changed: 4 ins; 0 del; 6 mod Patch: https://git.openjdk.org/jdk/pull/17410.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/17410/head:pull/17410 PR: https://git.openjdk.org/jdk/pull/17410 From darcy at openjdk.org Thu Jan 18 19:07:29 2024 From: darcy at openjdk.org (Joe Darcy) Date: Thu, 18 Jan 2024 19:07:29 GMT Subject: RFR: JDK-8323684: TypeMirror.{getAnnotationsByType, getAnnotation} return uninformative results [v3] In-Reply-To: References: <1cQBV_wn68b5NA_eCsBvI8gsK6gP8OcnKDpMHubwGgk=.70b8d284-8675-448f-98d6-10ecda0f1d16@github.com> Message-ID: <5nKu9m-rf81QVY23ztvum-w6hGh3rFwDHWJqFxicp9A=.bf8f727d-ae48-4491-ada8-d940d18c1b71@github.com> On Thu, 18 Jan 2024 01:19:41 GMT, Joe Darcy wrote: >> With my `javadoc` hat on, I would hope that `Element` is never `sealed`. But that's a separate issue. > > If we had sealed types when JSR 269 was in development, there are at least a few places in the API I would have liked to use them, in particular to seal javax.lang.model.UnknownEntityException to only have in-API subclasses. > > Given that the javax.lang.model.{element, type} packages were intended to allow multiple independent implementations, the root interfaces like element couldn't be sealed while achieving that goal. > > Inside javac, Type and Symbol could also be declared to be sealed rather than non-sealed, possibly at the cost of listed out all the subclasses. > @lahodaj or @vicente-romero-oracle , any thoughts on using sealed/non-sealed in javac in this way? > > If I don't here back from you on this point, I'll revert use of sealed/non-sealed before pushing. Thanks. Reverted sealed/non-sealed changes to get the rest of the fix in and filed JDK-8324167: Use sealed/non-sealed in javac implementation. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/17410#discussion_r1457867646 From darcy at openjdk.org Thu Jan 18 19:07:31 2024 From: darcy at openjdk.org (Joe Darcy) Date: Thu, 18 Jan 2024 19:07:31 GMT Subject: Integrated: JDK-8323684: TypeMirror.{getAnnotationsByType, getAnnotation} return uninformative results In-Reply-To: References: Message-ID: <82NX8S0SiCNEDZhFB5jJz2_V4ZnOMBuR1uD69dQo_MI=.879fc4ab-7198-4f17-9e51-087e3baf3c7b@github.com> On Fri, 12 Jan 2024 22:29:30 GMT, Joe Darcy wrote: > Initial implementation to make TypeMirror.{getAnnotationsByType, getAnnotation} functional; tests to follow. This pull request has now been integrated. Changeset: a6c0b107 Author: Joe Darcy URL: https://git.openjdk.org/jdk/commit/a6c0b10704311c94c179136b13a4dcc244e8011f Stats: 146 lines in 2 files changed: 128 ins; 14 del; 4 mod 8323684: TypeMirror.{getAnnotationsByType, getAnnotation} return uninformative results Reviewed-by: jjg ------------- PR: https://git.openjdk.org/jdk/pull/17410 From darcy at openjdk.org Thu Jan 18 20:38:31 2024 From: darcy at openjdk.org (Joe Darcy) Date: Thu, 18 Jan 2024 20:38:31 GMT Subject: RFR: JDK-8042981: Strip type annotations in Types' utility methods [v8] In-Reply-To: References: Message-ID: > Early review for JDK-8042981: "Strip type annotations in Types' utility methods". I work more often in the Element world rather than the Type word of the annotation processing APIs. > > The type annotations on primitive types are *not* cleared by the existing annotation clearing mechanisms. I suspect Type.Visitor is missing a case for primitive types. Someone with familiarity with javac's type modeling should take a look; thanks. Joe Darcy has updated the pull request with a new target base due to a merge or a rebase. The pull request now contains 12 commits: - Merge branch 'master' into JDK-8042981 - Revert changes that will be done under JDK-8323684. - Merge branch 'master' into JDK-8042981 - Update implementation and tests. - Add changes from Liam. - Merge branch 'master' into JDK-8042981 - Intermediate commit; add stripAnnotations method. - Merge branch 'master' into JDK-8042981 - Merge branch 'master' into JDK-8042981 - Update visitor; all langtools regression tests pass. - ... and 2 more: https://git.openjdk.org/jdk/compare/81df265e...72b9333a ------------- Changes: https://git.openjdk.org/jdk/pull/8984/files Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=8984&range=07 Stats: 317 lines in 5 files changed: 306 ins; 0 del; 11 mod Patch: https://git.openjdk.org/jdk/pull/8984.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/8984/head:pull/8984 PR: https://git.openjdk.org/jdk/pull/8984 From darcy at openjdk.org Thu Jan 18 20:42:29 2024 From: darcy at openjdk.org (Joe Darcy) Date: Thu, 18 Jan 2024 20:42:29 GMT Subject: RFR: JDK-8042981: Strip type annotations in Types' utility methods [v9] In-Reply-To: References: Message-ID: > Early review for JDK-8042981: "Strip type annotations in Types' utility methods". I work more often in the Element world rather than the Type word of the annotation processing APIs. > > The type annotations on primitive types are *not* cleared by the existing annotation clearing mechanisms. I suspect Type.Visitor is missing a case for primitive types. Someone with familiarity with javac's type modeling should take a look; thanks. Joe Darcy has updated the pull request incrementally with one additional commit since the last revision: Update regression test for fix of JDK-8323684. ------------- Changes: - all: https://git.openjdk.org/jdk/pull/8984/files - new: https://git.openjdk.org/jdk/pull/8984/files/72b9333a..48990299 Webrevs: - full: https://webrevs.openjdk.org/?repo=jdk&pr=8984&range=08 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=8984&range=07-08 Stats: 4 lines in 1 file changed: 0 ins; 0 del; 4 mod Patch: https://git.openjdk.org/jdk/pull/8984.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/8984/head:pull/8984 PR: https://git.openjdk.org/jdk/pull/8984 From darcy at openjdk.org Fri Jan 19 06:28:24 2024 From: darcy at openjdk.org (Joe Darcy) Date: Fri, 19 Jan 2024 06:28:24 GMT Subject: RFR: JDK-8042981: Strip type annotations in Types' utility methods [v10] In-Reply-To: References: Message-ID: > Early review for JDK-8042981: "Strip type annotations in Types' utility methods". I work more often in the Element world rather than the Type word of the annotation processing APIs. > > The type annotations on primitive types are *not* cleared by the existing annotation clearing mechanisms. I suspect Type.Visitor is missing a case for primitive types. Someone with familiarity with javac's type modeling should take a look; thanks. Joe Darcy has updated the pull request incrementally with one additional commit since the last revision: Augment tests. ------------- Changes: - all: https://git.openjdk.org/jdk/pull/8984/files - new: https://git.openjdk.org/jdk/pull/8984/files/48990299..2ad7f7ec Webrevs: - full: https://webrevs.openjdk.org/?repo=jdk&pr=8984&range=09 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=8984&range=08-09 Stats: 70 lines in 2 files changed: 62 ins; 0 del; 8 mod Patch: https://git.openjdk.org/jdk/pull/8984.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/8984/head:pull/8984 PR: https://git.openjdk.org/jdk/pull/8984 From prappo at openjdk.org Fri Jan 19 10:55:36 2024 From: prappo at openjdk.org (Pavel Rappo) Date: Fri, 19 Jan 2024 10:55:36 GMT Subject: RFR: JDK-8298405: Support Markdown in Documentation Comments [v6] In-Reply-To: <0mlIFIZ2ec8oE2zlmKxoMwp59dBgOdUQs-vzTLnU7hI=.15fa2827-8c87-415b-ab74-0e42b45a5cf7@github.com> References: <0mlIFIZ2ec8oE2zlmKxoMwp59dBgOdUQs-vzTLnU7hI=.15fa2827-8c87-415b-ab74-0e42b45a5cf7@github.com> Message-ID: On Mon, 8 Jan 2024 21:26:50 GMT, Jonathan Gibbons wrote: >> Please review a patch to add support for Markdown syntax in documentation comments, as described in the associated JEP. >> >> Notable features: >> >> * support for `///` documentation comments in `JavaTokenizer` >> * new module `jdk.internal.md` -- a private copy of the `commonmark-java` library >> * updates to `DocCommentParser` to treat `///` comments as Markdown >> * updates to the standard doclet to render Markdown comments in HTML > > Jonathan Gibbons 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 seven additional commits since the last revision: > > - Merge with upstream/master > - Merge remote-tracking branch 'upstream/master' into 8298405.doclet-markdown-v3 > - Address review comments > - Fix whitespace > - Improve handling of embedded inline taglets > - Customize support for Markdown headings > - JDK-8298405: Support Markdown in Documentation Comments Jon, please sync this PR with mainline to resolve conflicts. ------------- PR Comment: https://git.openjdk.org/jdk/pull/16388#issuecomment-1900181880 From acobbs at openjdk.org Fri Jan 19 15:38:39 2024 From: acobbs at openjdk.org (Archie Cobbs) Date: Fri, 19 Jan 2024 15:38:39 GMT Subject: RFR: 8317376: Minor improvements to the 'this' escape analyzer [v2] In-Reply-To: References: Message-ID: > Please review several fixes and improvements to the `this-escape` lint warning analyzer. > > The goal here is to apply some relatively simple logical fixes that improve the precision and accuracy of the analyzer, and capture the remaining low-hanging fruit so we can consider the analyzer relatively complete with respect to what's feasible with its current design. > > Although the changes are small from a logical point of view, they generate a fairly large patch due to impact of refactoring (sorry!). Most of the patch derives from the first two changes listed below. > > The changes are summarized here: > > #### 1. Generalize how we categorize references > > The `Ref` class hierarchy models the various ways in which, at any point during the execution of a constructor or some other method/constructor that it invokes, there can be live references to the original object under construction lying around. We then look for places where one of these `Ref`'s might be passed to a subclass method. In other words, the analyzer keeps track of these references and watches what happens to them as the code executes so it can catch them trying to "escape". > > Previously the `Ref` categories were: > * `ThisRef` - The current instance of the (non-static) method or constructor being analyzed > * `OuterRef` - The current outer instance of the (non-static) method or constructor being analyzed > * `VarRef` - A local variable or method parameter currently in scope > * `ExprRef` - An object reference sitting on top of the Java execution stack > * `YieldRef` - The current switch expression's yield value(s) > * `ReturnRef` - The current method's return value(s) > > For each of those types, we further classified the "indirection" of the reference, i.e., whether the reference was direct (from the thing itself) or indirect (from something the thing referenced). > > The problem with that hierarchy is that we could only track outer instance references that happened to be associated with the current instance. So we might know that `this` had an outer instance reference, but if we said `var x = this` we wouldn't know that `x` had an outer instance reference. > > In other words, we should be treating "via an outer instance" as just another flavor of indirection along with "direct" and "indirect". > > As a result, with this patch the `OuterRef` class goes away and a new `Indirection` enum has been created, with values `DIRECT`, `INDIRECT`, and `OUTER`. > > #### 2. Track the types of all references > > By keeping track of the actual type of... Archie Cobbs has updated the pull request with a new target base due to a merge or a rebase. The pull request now contains six commits: - Merge branch 'master' into JDK-8317376 - Merge branch 'master' into JDK-8317376 - Merge branch 'master' into JDK-8317376 - Javadoc++ - Merge branch 'master' into JDK-8317376 - Several improvements to the 'this' escape analyzer. - Track direct, indirect, and outer references for all Ref types. - Keep type information about all references to improve tracking precision. - Track enhanced for() invocations of iterator(), hasNext(), and next(). - Don't report an escape of a non-public outer instances as a leak. - Fix omitted tracking of references from newly instantiated instances. - Fix omitted tracking of leaks via lambda return values. - Remove unneccesary suppressions of this-escape lint warning. ------------- Changes: https://git.openjdk.org/jdk/pull/16208/files Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=16208&range=01 Stats: 871 lines in 20 files changed: 513 ins; 148 del; 210 mod Patch: https://git.openjdk.org/jdk/pull/16208.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/16208/head:pull/16208 PR: https://git.openjdk.org/jdk/pull/16208 From prappo at openjdk.org Fri Jan 19 17:53:38 2024 From: prappo at openjdk.org (Pavel Rappo) Date: Fri, 19 Jan 2024 17:53:38 GMT Subject: RFR: JDK-8298405: Support Markdown in Documentation Comments [v6] In-Reply-To: <6df9dQzBK0M7SlHDpNO4T_bhE7i6WqwLP64cs6Df9A8=.e08f76a3-8753-4bad-9325-b0ab042645a4@github.com> References: <0mlIFIZ2ec8oE2zlmKxoMwp59dBgOdUQs-vzTLnU7hI=.15fa2827-8c87-415b-ab74-0e42b45a5cf7@github.com> <6df9dQzBK0M7SlHDpNO4T_bhE7i6WqwLP64cs6Df9A8=.e08f76a3-8753-4bad-9325-b0ab042645a4@github.com> Message-ID: On Fri, 12 Jan 2024 17:47:06 GMT, Pavel Rappo wrote: >> Jonathan Gibbons 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 seven additional commits since the last revision: >> >> - Merge with upstream/master >> - Merge remote-tracking branch 'upstream/master' into 8298405.doclet-markdown-v3 >> - Address review comments >> - Fix whitespace >> - Improve handling of embedded inline taglets >> - Customize support for Markdown headings >> - JDK-8298405: Support Markdown in Documentation Comments > > src/jdk.compiler/share/classes/com/sun/tools/javac/api/JavacTrees.java line 992: > >> 990: >> 991: private static boolean isMarkdownFile(FileObject fo) { >> 992: return fo.getName().endsWith(".md"); > > I wonder why you decided to (re)implement those methods using file extension matching. Is it because we don't want to introduce anything Markdown-related to this method that was used to implement `isHtmlFile` previously? > https://github.com/openjdk/jdk/blob/8eb4e7e07e9211aabcb0f22696e9c572dac7a59f/src/jdk.compiler/share/classes/com/sun/tools/javac/file/BaseFileManager.java#L489-L498 Musing on this more. Can/should we, without introducing probably unwelcome `Kind.MD` to `javax.tools.JavaFileObject.Kind`, teach javac to recognise `package.md` similarly to how it recognises legacy `package.html`? If we are aiming for Markdown to be a drop in replacement for traditional javadoc comments, we might want to go the extra mile. I'm pleased to see that Markdown `-overview` files work just fine. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/16388#discussion_r1459349927 From prappo at openjdk.org Fri Jan 19 17:53:43 2024 From: prappo at openjdk.org (Pavel Rappo) Date: Fri, 19 Jan 2024 17:53:43 GMT Subject: RFR: JDK-8298405: Support Markdown in Documentation Comments [v6] In-Reply-To: <0mlIFIZ2ec8oE2zlmKxoMwp59dBgOdUQs-vzTLnU7hI=.15fa2827-8c87-415b-ab74-0e42b45a5cf7@github.com> References: <0mlIFIZ2ec8oE2zlmKxoMwp59dBgOdUQs-vzTLnU7hI=.15fa2827-8c87-415b-ab74-0e42b45a5cf7@github.com> Message-ID: On Mon, 8 Jan 2024 21:26:50 GMT, Jonathan Gibbons wrote: >> Please review a patch to add support for Markdown syntax in documentation comments, as described in the associated JEP. >> >> Notable features: >> >> * support for `///` documentation comments in `JavaTokenizer` >> * new module `jdk.internal.md` -- a private copy of the `commonmark-java` library >> * updates to `DocCommentParser` to treat `///` comments as Markdown >> * updates to the standard doclet to render Markdown comments in HTML > > Jonathan Gibbons 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 seven additional commits since the last revision: > > - Merge with upstream/master > - Merge remote-tracking branch 'upstream/master' into 8298405.doclet-markdown-v3 > - Address review comments > - Fix whitespace > - Improve handling of embedded inline taglets > - Customize support for Markdown headings > - JDK-8298405: Support Markdown in Documentation Comments src/jdk.compiler/share/classes/com/sun/tools/javac/parser/DocCommentParser.java line 259: > 257: LineKind lineKind = textKind == DocTree.Kind.MARKDOWN ? peekLineKind() : null; > 258: > 259: if (DEBUG) System.err.println("starting content " + showPos(bp) + " " + newline); Debug output is useful. I wonder if we should consider https://openjdk.org/jeps/264. src/jdk.compiler/share/classes/com/sun/tools/javac/parser/DocCommentParser.java line 1295: > 1293: switch (ch) { > 1294: case ' ' -> indent++; > 1295: case '\t' -> indent = 4; Shouldn't it be like this or it does not matter? ```suggestion case '\t' -> indent += 4; src/jdk.compiler/share/classes/com/sun/tools/javac/parser/DocCommentParser.java line 1336: > 1334: switch (initialLineKind) { > 1335: case CODE_FENCE -> { > 1336: if (lineKind == LineKind.CODE_FENCE && ch == term && count(ch) == count) { https://spec.commonmark.org/0.30/#example-124 shows that the closing fence may be longer than the opening one: consider `count(ch) >= count`. That said, I note that on my experiment the resulting output was identical with or without the change I ask you to consider. Perhaps I haven't yet understood how the parsing works. src/jdk.compiler/share/classes/com/sun/tools/javac/parser/DocCommentParser.java line 1377: > 1375: * @see
    ATX Headings > 1376: */ > 1377: ATX_HEADER(Pattern.compile("#{1,6}( .*|$)")), Nothing wrong here, I just didn't know that an ATX header "opening sequence of # characters" can be followed by the end of line". Interesting. src/jdk.compiler/share/classes/com/sun/tools/javac/parser/DocCommentParser.java line 1421: > 1419: case '#', '=', '-', '+', '_', '`', '~' -> { > 1420: String line = peekLine(); > 1421: for (LineKind lk : LineKind.values()) { Nothing wrong here, just noting that this is one more way one can depend on an enum constant order. Change it, and a peeked line kind might change too (e.g. `OTHER` matches everything.) ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/16388#discussion_r1458858629 PR Review Comment: https://git.openjdk.org/jdk/pull/16388#discussion_r1452560905 PR Review Comment: https://git.openjdk.org/jdk/pull/16388#discussion_r1452650328 PR Review Comment: https://git.openjdk.org/jdk/pull/16388#discussion_r1452629053 PR Review Comment: https://git.openjdk.org/jdk/pull/16388#discussion_r1452632699 From darcy at openjdk.org Fri Jan 19 18:19:35 2024 From: darcy at openjdk.org (Joe Darcy) Date: Fri, 19 Jan 2024 18:19:35 GMT Subject: RFR: JDK-8042981: Strip type annotations in Types' utility methods [v5] In-Reply-To: References: <9mAqXAAjAmhg90Yf_7fuGFridDdRXJ78q1vlJx50T9c=.d0eb9c81-6cbf-4459-b36c-18058722bb50@github.com> Message-ID: On Fri, 12 Jan 2024 20:28:00 GMT, Liam Miller-Cushon wrote: >> Joe Darcy has updated the pull request incrementally with one additional commit since the last revision: >> >> Update implementation and tests. > > test/langtools/tools/javac/processing/model/util/types/TestAnnotationStripping.java line 140: > >> 138: } >> 139: >> 140: void checkEmptyAnnotations(AnnotatedConstruct ac) { > > I think it would be valuable to expand the assertion to visit contained types, and assert that none of the contained types have annotations: > > > diff --git a/test/langtools/tools/javac/processing/model/util/types/TestAnnotationStripping.java b/test/langtools/tools/javac/processing/model/util/types/TestAnnotationStripping.java > index c627f41ba0b..8bb3c7cd3a8 100644 > --- a/test/langtools/tools/javac/processing/model/util/types/TestAnnotationStripping.java > +++ b/test/langtools/tools/javac/processing/model/util/types/TestAnnotationStripping.java > @@ -82,10 +82,10 @@ public boolean process(Set annotations, > > System.err.print("\tgetArrayType()"); > ArrayType arrayType = typeUtils.getArrayType(returnType); > - checkEmptyAnnotations(arrayType); > /* > * "Annotations on the component type are preserved." > */ > + checkEmptyAnnotations((AnnotatedConstruct) arrayType); > checkEqualTypeAndAnnotations(returnType, arrayType.getComponentType()); > > if (!returnType.getKind().isPrimitive()) { > @@ -93,10 +93,14 @@ public boolean process(Set annotations, > * "Annotations on the bounds are preserved." > */ > WildcardType wcType; > - checkEmptyAnnotations(wcType = typeUtils.getWildcardType(returnType, null)); > + System.err.print("\tgetWildcardType(returnType, null)"); > + wcType = typeUtils.getWildcardType(returnType, null); > + checkEmptyAnnotations((AnnotatedConstruct) wcType); > checkEqualTypeAndAnnotations(returnType, wcType.getExtendsBound()); > > - checkEmptyAnnotations(wcType = typeUtils.getWildcardType(null, returnType)); > + System.err.print("\tgetWildcardType(null, returnType)"); > + wcType = typeUtils.getWildcardType(null, returnType); > + checkEmptyAnnotations((AnnotatedConstruct) wcType); > checkEqualTypeAndAnnotations(returnType, wcType.getSuperBound()); > } > > @@ -158,6 +162,54 @@ void checkEmptyAnnotations(AnnotatedConstruct ac) { > } > } > > + void ch... > I think it would be valuable to expand the assertion to visit contained types, and assert that none of the contained types have annotations: > > ```diff > diff --git a/test/langtools/tools/javac/processing/model/util/types/TestAnnotationStripping.java b/test/langtools/tools/javac/processing/model/util/types/TestAnnotationStripping.java > index c627f41ba0b..8bb3c7cd3a8 100644 > --- a/test/langtools/tools/javac/processing/model/util/types/TestAnnotationStripping.java > +++ b/test/langtools/tools/javac/processing/model/util/types/TestAnnotationStripping.java > @@ -82,10 +82,10 @@ public boolean process(Set annotations, > > System.err.print("\tgetArrayType()"); > ArrayType arrayType = typeUtils.getArrayType(returnType); > - checkEmptyAnnotations(arrayType); > /* > * "Annotations on the component type are preserved." > */ > + checkEmptyAnnotations((AnnotatedConstruct) arrayType); > checkEqualTypeAndAnnotations(returnType, arrayType.getComponentType()); > > if (!returnType.getKind().isPrimitive()) { > @@ -93,10 +93,14 @@ public boolean process(Set annotations, > * "Annotations on the bounds are preserved." > */ > WildcardType wcType; > - checkEmptyAnnotations(wcType = typeUtils.getWildcardType(returnType, null)); > + System.err.print("\tgetWildcardType(returnType, null)"); > + wcType = typeUtils.getWildcardType(returnType, null); > + checkEmptyAnnotations((AnnotatedConstruct) wcType); > checkEqualTypeAndAnnotations(returnType, wcType.getExtendsBound()); > > - checkEmptyAnnotations(wcType = typeUtils.getWildcardType(null, returnType)); > + System.err.print("\tgetWildcardType(null, returnType)"); > + wcType = typeUtils.getWildcardType(null, returnType); > + checkEmptyAnnotations((AnnotatedConstruct) wcType); > checkEqualTypeAndAnnotations(returnType, wcType.getSuperBound()); > } > > @@ -158,6 +162,54 @@ void checkEmptyAnnotations(AnnotatedConstruct ac) { > } > } > > + void checkEmptyAnnotations(TypeMirror ac) { > + System.err.println("\t" + ac); > + if (ac == null) { > + return; > + } > + new SimpleTypeVisitor14() { > + @Override > + protected Void defaultAction(TypeMirror t, Void o) { > + checkEmptyAnnotations((AnnotatedConstruct) t); > + return null; > + } > + > + @Override > + public Void visitArray(ArrayType t, Void o) { > + scan(t.getComponentType()); > + return super.visitArray(t, o); > + } > + > + @Override > + public Void visitDeclared(DeclaredType t, Void o) { > + scan(t.getEnclosingType()); > + t.getTypeArguments().stream().forEach(this::scan); > + return super.visitDeclared(t, o); > + } > + > + @Override > + public Void visitTypeVariable(TypeVariable t, Void o) { > + // the bounds correspond to the type variable declaration, not its use > + // scan(t.getUpperBound()); > + // scan(t.getLowerBound()); > + return super.visitTypeVariable(t, o); > + } > + > + @Override > + public Void visitWildcard(WildcardType t, Void o) { > + scan(t.getExtendsBound()); > + scan(t.getSuperBound()); > + return super.visitWildcard(t, o); > + } > + > + private void scan(TypeMirror t) { > + if (t != null) { > + visit(t); > + } > + } > + }.visit(ac); > + } > + > void checkEqualTypeAndAnnotations(TypeMirror tm1, TypeMirror tm2) { > if (!typeUtils.isSameType(tm1, tm2)) { > failures++; > ``` I've added a variation of the new code to the PR. The checks I added are in line with the properties discussed by the API changes in Types. Thanks. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/8984#discussion_r1459485081 From jjg at openjdk.org Fri Jan 19 18:37:48 2024 From: jjg at openjdk.org (Jonathan Gibbons) Date: Fri, 19 Jan 2024 18:37:48 GMT Subject: RFR: JDK-8298405: Support Markdown in Documentation Comments [v7] In-Reply-To: References: Message-ID: <0pRMUgBnvCfb7DTm_pDnIlmuYdXH8URKFAIk5cT082Y=.f4c324b6-ef98-41b3-9b06-9cb82e03b08f@github.com> > Please review a patch to add support for Markdown syntax in documentation comments, as described in the associated JEP. > > Notable features: > > * support for `///` documentation comments in `JavaTokenizer` > * new module `jdk.internal.md` -- a private copy of the `commonmark-java` library > * updates to `DocCommentParser` to treat `///` comments as Markdown > * updates to the standard doclet to render Markdown comments in HTML Jonathan Gibbons has updated the pull request with a new target base due to a merge or a rebase. The pull request now contains eight commits: - Merge with upstream/master - Merge with upstream/master - Merge remote-tracking branch 'upstream/master' into 8298405.doclet-markdown-v3 - Address review comments - Fix whitespace - Improve handling of embedded inline taglets - Customize support for Markdown headings - JDK-8298405: Support Markdown in Documentation Comments ------------- Changes: https://git.openjdk.org/jdk/pull/16388/files Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=16388&range=06 Stats: 21334 lines in 191 files changed: 20679 ins; 266 del; 389 mod Patch: https://git.openjdk.org/jdk/pull/16388.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/16388/head:pull/16388 PR: https://git.openjdk.org/jdk/pull/16388 From cushon at openjdk.org Fri Jan 19 23:05:43 2024 From: cushon at openjdk.org (Liam Miller-Cushon) Date: Fri, 19 Jan 2024 23:05:43 GMT Subject: RFR: JDK-8042981: Strip type annotations in Types' utility methods [v10] In-Reply-To: References: Message-ID: On Fri, 19 Jan 2024 06:28:24 GMT, Joe Darcy wrote: >> Early review for JDK-8042981: "Strip type annotations in Types' utility methods". I work more often in the Element world rather than the Type word of the annotation processing APIs. >> >> The type annotations on primitive types are *not* cleared by the existing annotation clearing mechanisms. I suspect Type.Visitor is missing a case for primitive types. Someone with familiarity with javac's type modeling should take a look; thanks. > > Joe Darcy has updated the pull request incrementally with one additional commit since the last revision: > > Augment tests. This looks good to me test/langtools/tools/javac/processing/model/util/types/TestAnnotationStripping.java line 148: > 146: else { > 147: // Previously, was likely getting by-catch of annotations > 148: // on element declartions, can likely just print the size typo: `s/declartions/declarations` And per the explanation in this comment, I think the commented-out case for `jdk.internal.ValueBased` can be removed if the test passes without it ------------- Marked as reviewed by cushon (Committer). PR Review: https://git.openjdk.org/jdk/pull/8984#pullrequestreview-1833537216 PR Review Comment: https://git.openjdk.org/jdk/pull/8984#discussion_r1459617560 From darcy at openjdk.org Sat Jan 20 00:07:45 2024 From: darcy at openjdk.org (Joe Darcy) Date: Sat, 20 Jan 2024 00:07:45 GMT Subject: RFR: JDK-8042981: Strip type annotations in Types' utility methods [v11] In-Reply-To: References: Message-ID: > Early review for JDK-8042981: "Strip type annotations in Types' utility methods". I work more often in the Element world rather than the Type word of the annotation processing APIs. > > The type annotations on primitive types are *not* cleared by the existing annotation clearing mechanisms. I suspect Type.Visitor is missing a case for primitive types. Someone with familiarity with javac's type modeling should take a look; thanks. Joe Darcy has updated the pull request incrementally with one additional commit since the last revision: Clean up regression test. ------------- Changes: - all: https://git.openjdk.org/jdk/pull/8984/files - new: https://git.openjdk.org/jdk/pull/8984/files/2ad7f7ec..bacbd1dd Webrevs: - full: https://webrevs.openjdk.org/?repo=jdk&pr=8984&range=10 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=8984&range=09-10 Stats: 53 lines in 1 file changed: 36 ins; 12 del; 5 mod Patch: https://git.openjdk.org/jdk/pull/8984.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/8984/head:pull/8984 PR: https://git.openjdk.org/jdk/pull/8984 From darcy at openjdk.org Sat Jan 20 00:11:30 2024 From: darcy at openjdk.org (Joe Darcy) Date: Sat, 20 Jan 2024 00:11:30 GMT Subject: RFR: JDK-8042981: Strip type annotations in Types' utility methods [v10] In-Reply-To: References: Message-ID: On Fri, 19 Jan 2024 19:30:01 GMT, Liam Miller-Cushon wrote: >> Joe Darcy has updated the pull request incrementally with one additional commit since the last revision: >> >> Augment tests. > > test/langtools/tools/javac/processing/model/util/types/TestAnnotationStripping.java line 148: > >> 146: else { >> 147: // Previously, was likely getting by-catch of annotations >> 148: // on element declartions, can likely just print the size > > typo: `s/declartions/declarations` > > And per the explanation in this comment, I think the commented-out case for `jdk.internal.ValueBased` can be removed if the test passes without it Pushed this and some other regression test cleanups/augmentations. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/8984#discussion_r1460035752 From vromero at openjdk.org Sat Jan 20 02:19:26 2024 From: vromero at openjdk.org (Vicente Romero) Date: Sat, 20 Jan 2024 02:19:26 GMT Subject: RFR: 8323657: Compilation of snippet results in VerifyError at runtime with --release 9 (and above) In-Reply-To: <8J6pCJK0dp-jErumOx3a8Ht-KdGJassMr4ZV9Th1DTo=.2090fe6d-a51c-41b0-a095-d1bf7c60b6f8@github.com> References: <8J6pCJK0dp-jErumOx3a8Ht-KdGJassMr4ZV9Th1DTo=.2090fe6d-a51c-41b0-a095-d1bf7c60b6f8@github.com> Message-ID: On Thu, 18 Jan 2024 10:57:24 GMT, Jan Lahoda wrote: > Consider code like: > > public class Test { > public static void main(String... args) { > System.err.println((test() ? null : null) + ""); > } > private static boolean test() { > System.err.println("test called!"); > return true; > } > } > > > This should print: > > test called! > null > > > but it prints: > > $ java /tmp/Test.java > null > > > The correct semantics can be achieved by using `--source 8`: > > $ java --source 8 /tmp/Test.java > test called! > null > > > Or `-XDstringConcat=inline` when compiling. > > The reason is that when `StringConcat.IndyConstants` converts String concatenation parameters, it will short-circuit any expressions whose type is BOT (i.e. basically the `null` type). But, in this case, the expression that has the BOT type is a complex expression with a side-effect, so short-circuiting it leads to a broken semantics. > > My proposal is to "short-circuit" only `null` literals, and generate other expressions normally. There may be some corner cases where we'd generate the expression unnecessarily (if it does not have any side-effect), but looking for side-effects seems unnecessarily complex and fragile given I'd expect non-trivial expressions with the BOT type are very rare. (The only case which comes to mind is exactly the above one - a conditional expressions, whose both result values are `null`.) > > Please note that when the expression is incorrectly short-circuited, it may lead to various other effects - the original bug report shows a case where the resulting code does not pass the verification. lgtm ------------- Marked as reviewed by vromero (Reviewer). PR Review: https://git.openjdk.org/jdk/pull/17483#pullrequestreview-1834333082 From darcy at openjdk.org Sat Jan 20 21:59:46 2024 From: darcy at openjdk.org (Joe Darcy) Date: Sat, 20 Jan 2024 21:59:46 GMT Subject: RFR: JDK-8042981: Strip type annotations in Types' utility methods [v12] In-Reply-To: References: Message-ID: > Early review for JDK-8042981: "Strip type annotations in Types' utility methods". I work more often in the Element world rather than the Type word of the annotation processing APIs. > > The type annotations on primitive types are *not* cleared by the existing annotation clearing mechanisms. I suspect Type.Visitor is missing a case for primitive types. Someone with familiarity with javac's type modeling should take a look; thanks. Joe Darcy has updated the pull request incrementally with one additional commit since the last revision: Make make of stripAnnotations more explicit. ------------- Changes: - all: https://git.openjdk.org/jdk/pull/8984/files - new: https://git.openjdk.org/jdk/pull/8984/files/bacbd1dd..450ae6b2 Webrevs: - full: https://webrevs.openjdk.org/?repo=jdk&pr=8984&range=11 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=8984&range=10-11 Stats: 5 lines in 1 file changed: 5 ins; 0 del; 0 mod Patch: https://git.openjdk.org/jdk/pull/8984.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/8984/head:pull/8984 PR: https://git.openjdk.org/jdk/pull/8984 From darcy at openjdk.org Sat Jan 20 22:16:29 2024 From: darcy at openjdk.org (Joe Darcy) Date: Sat, 20 Jan 2024 22:16:29 GMT Subject: RFR: JDK-8042981: Strip type annotations in Types' utility methods [v12] In-Reply-To: References: Message-ID: On Sat, 20 Jan 2024 21:59:46 GMT, Joe Darcy wrote: >> Early review for JDK-8042981: "Strip type annotations in Types' utility methods". I work more often in the Element world rather than the Type word of the annotation processing APIs. >> >> The type annotations on primitive types are *not* cleared by the existing annotation clearing mechanisms. I suspect Type.Visitor is missing a case for primitive types. Someone with familiarity with javac's type modeling should take a look; thanks. > > Joe Darcy has updated the pull request incrementally with one additional commit since the last revision: > > Make make of stripAnnotations more explicit. CSR https://bugs.openjdk.org/browse/JDK-8323620 updated with latest specification. ------------- PR Comment: https://git.openjdk.org/jdk/pull/8984#issuecomment-1902277340 From abimpoudis at openjdk.org Mon Jan 22 09:41:50 2024 From: abimpoudis at openjdk.org (Aggelos Biboudis) Date: Mon, 22 Jan 2024 09:41:50 GMT Subject: RFR: 8303374: Compiler Implementation for Primitive types in patterns, instanceof, and switch (Preview) [v39] 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 56 commits: - Update copyright year, javadoc, JDK version - Merge branch 'master' into primitive-patterns - Merge branch 'master' into primitive-patterns - Cleanup - Merge branch 'master' into primitive-patterns - Remove trailing spaces - Merge branch 'primitive-patterns-and-generating-dispatch' into primitive-patterns - Fixed switch in the cases of unboxing and widening - Merge branch 'JDK-8319220' into primitive-patterns - Merge branch 'master' into JDK-8319220 - ... and 46 more: https://git.openjdk.org/jdk/compare/9049402a...676af9de ------------- Changes: https://git.openjdk.org/jdk/pull/15638/files Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=15638&range=38 Stats: 3281 lines in 41 files changed: 3000 ins; 110 del; 171 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 Jan 22 10:48:05 2024 From: abimpoudis at openjdk.org (Aggelos Biboudis) Date: Mon, 22 Jan 2024 10:48:05 GMT Subject: RFR: 8303374: Compiler Implementation for Primitive types in patterns, instanceof, and switch (Preview) [v40] In-Reply-To: <4GCkSMggtYI8KnM-kELHez3Nd42WIrfd6jOF1bbK5PA=.12aec6f3-669b-4675-ad34-ffe28cb23459@github.com> References: <4GCkSMggtYI8KnM-kELHez3Nd42WIrfd6jOF1bbK5PA=.12aec6f3-669b-4675-ad34-ffe28cb23459@github.com> Message-ID: <3q3UXhPplqk5X8E0rnHuEyUFY-HiAIQSYPgBJeIXzEE=.bcc70cff-e2da-471b-abea-7ed23d168e18@github.com> > 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 incrementally with two additional commits since the last revision: - Update ExactConversionsSupport Javadoc and JDK version - Revert "Update copyright year, javadoc, JDK version" This reverts commit 676af9de90d946f64f34762a6df94dbd91bce41b. ------------- Changes: - all: https://git.openjdk.org/jdk/pull/15638/files - new: https://git.openjdk.org/jdk/pull/15638/files/676af9de..ed61d5fd Webrevs: - full: https://webrevs.openjdk.org/?repo=jdk&pr=15638&range=39 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=15638&range=38-39 Stats: 27 lines in 27 files changed: 0 ins; 0 del; 27 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 Mon Jan 22 10:58:35 2024 From: jlahoda at openjdk.org (Jan Lahoda) Date: Mon, 22 Jan 2024 10:58:35 GMT Subject: Integrated: 8323057: Recoverable errors may be reported before unrecoverable errors when annotation processing is skipped In-Reply-To: References: Message-ID: On Fri, 5 Jan 2024 19:51:35 GMT, Jan Lahoda wrote: > When annotation processing is requested, some errors reported during enter may be resolved by the annotation processors. So, javac stashes the errors from enter aside. When an error that cannot be resolved by annotation processing is found in the stashed errors, the annotation processors all the errors will be printed. > > This may be confusing if there's one important non-resolvable error, hidden among many errors that would be resolved by the annotation processors. The proposal herein is therefore to first print the not-recoverable errors, and only then the recoverable errors, when the errors are stashed away and then re-printed. This pull request has now been integrated. Changeset: 72f19902 Author: Jan Lahoda URL: https://git.openjdk.org/jdk/commit/72f199024d58b53a1dff2f79dd2050ae0044e809 Stats: 152 lines in 4 files changed: 134 ins; 11 del; 7 mod 8323057: Recoverable errors may be reported before unrecoverable errors when annotation processing is skipped Reviewed-by: vromero ------------- PR: https://git.openjdk.org/jdk/pull/17286 From jlahoda at openjdk.org Mon Jan 22 13:09:36 2024 From: jlahoda at openjdk.org (Jan Lahoda) Date: Mon, 22 Jan 2024 13:09:36 GMT Subject: Integrated: 8323657: Compilation of snippet results in VerifyError at runtime with --release 9 (and above) In-Reply-To: <8J6pCJK0dp-jErumOx3a8Ht-KdGJassMr4ZV9Th1DTo=.2090fe6d-a51c-41b0-a095-d1bf7c60b6f8@github.com> References: <8J6pCJK0dp-jErumOx3a8Ht-KdGJassMr4ZV9Th1DTo=.2090fe6d-a51c-41b0-a095-d1bf7c60b6f8@github.com> Message-ID: On Thu, 18 Jan 2024 10:57:24 GMT, Jan Lahoda wrote: > Consider code like: > > public class Test { > public static void main(String... args) { > System.err.println((test() ? null : null) + ""); > } > private static boolean test() { > System.err.println("test called!"); > return true; > } > } > > > This should print: > > test called! > null > > > but it prints: > > $ java /tmp/Test.java > null > > > The correct semantics can be achieved by using `--source 8`: > > $ java --source 8 /tmp/Test.java > test called! > null > > > Or `-XDstringConcat=inline` when compiling. > > The reason is that when `StringConcat.IndyConstants` converts String concatenation parameters, it will short-circuit any expressions whose type is BOT (i.e. basically the `null` type). But, in this case, the expression that has the BOT type is a complex expression with a side-effect, so short-circuiting it leads to a broken semantics. > > My proposal is to "short-circuit" only `null` literals, and generate other expressions normally. There may be some corner cases where we'd generate the expression unnecessarily (if it does not have any side-effect), but looking for side-effects seems unnecessarily complex and fragile given I'd expect non-trivial expressions with the BOT type are very rare. (The only case which comes to mind is exactly the above one - a conditional expressions, whose both result values are `null`.) > > Please note that when the expression is incorrectly short-circuited, it may lead to various other effects - the original bug report shows a case where the resulting code does not pass the verification. This pull request has now been integrated. Changeset: c9cacfb2 Author: Jan Lahoda URL: https://git.openjdk.org/jdk/commit/c9cacfb25d1f15c879c961d2965a63c9fe4d9fa7 Stats: 65 lines in 2 files changed: 64 ins; 0 del; 1 mod 8323657: Compilation of snippet results in VerifyError at runtime with --release 9 (and above) Reviewed-by: vromero ------------- PR: https://git.openjdk.org/jdk/pull/17483 From hannesw at openjdk.org Mon Jan 22 15:17:28 2024 From: hannesw at openjdk.org (Hannes =?UTF-8?B?V2FsbG7DtmZlcg==?=) Date: Mon, 22 Jan 2024 15:17:28 GMT Subject: RFR: JDK-8164094: javadoc allows to create a @link to a non-existent method [v2] In-Reply-To: <_pikP7s04dGw96fPV2zU1ONXSPGQoZo4SRfYNifChBM=.00cf8f90-bb98-4ca2-9dc0-1a77d76462b6@github.com> References: <-xM8YSleEZ-CQY1FwsTvPsgYW3s8GmkOkGi-9r8icuI=.da06c781-54fe-463a-abd7-c714e4d3982f@github.com> <_pikP7s04dGw96fPV2zU1ONXSPGQoZo4SRfYNifChBM=.00cf8f90-bb98-4ca2-9dc0-1a77d76462b6@github.com> Message-ID: <6iTfL0RE9jqees8i6HOUWCHjdCwDkeXZRnWdUHAv_Ec=.c687ed6a-a072-4b4b-8575-a7c3629c26a6@github.com> On Wed, 13 Dec 2023 10:44:43 GMT, Hannes Walln?fer wrote: >> Should this issue have a CSR for the behavioral change? > >> Should this issue have a CSR for the behavioral change? > > My understanding of the issue is that the lookup of explicit-class member references in enclosing classes was an unintended consequence of doing the same for classless references from within nested classes. So I consider this a bug fix, not a feature change (even though it unfortunately changes javadoc to become stricter in what it accepts). > > Actually, the feature of extending member reference lookup to enclosing classes is not specified in the taglet spec, which only says this: > >> When the reference is to a member of the same class as that containing the documentation comment, all parts of the reference up to and including the # may be omitted, although the '#' may be retained for clarity. > > This could be extended to include enclosing classes, but this is existing behaviour, not changed by this issue. > @hns would you be able to create a linked bug to track that lookup order issue? I filed an issue for it here: https://bugs.openjdk.org/browse/JDK-8324320 Ping: since most of the discussion in this PR was off-topic, could somebody please review the actual change? ------------- PR Comment: https://git.openjdk.org/jdk/pull/17069#issuecomment-1904218001 From prappo at openjdk.org Mon Jan 22 15:23:32 2024 From: prappo at openjdk.org (Pavel Rappo) Date: Mon, 22 Jan 2024 15:23:32 GMT Subject: RFR: JDK-8164094: javadoc allows to create a @link to a non-existent method [v2] In-Reply-To: References: <-xM8YSleEZ-CQY1FwsTvPsgYW3s8GmkOkGi-9r8icuI=.da06c781-54fe-463a-abd7-c714e4d3982f@github.com> Message-ID: On Tue, 12 Dec 2023 12:42:41 GMT, Hannes Walln?fer wrote: >> Please review a simple fix in `JavacTrees` to only look up member references in the enclosing type if the reference does not contain an explicit type name. For example, `@see #method()` in a a doc comment of class `Outer.Inner` should find method `Outer.method()`, but `@see Inner#method()` should not (regardless of comment location). > > Hannes Walln?fer 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 three additional commits since the last revision: > > - Merge branch 'master' into JDK-8164094 > - Additional test > - JDK-8164094: javadoc allows to create a @link to a non-existent method Marked as reviewed by prappo (Reviewer). ------------- PR Review: https://git.openjdk.org/jdk/pull/17069#pullrequestreview-1836726468 From abimpoudis at openjdk.org Mon Jan 22 18:42:56 2024 From: abimpoudis at openjdk.org (Aggelos Biboudis) Date: Mon, 22 Jan 2024 18:42:56 GMT Subject: RFR: 8303374: Compiler Implementation for Primitive types in patterns, instanceof, and switch (Preview) [v41] 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 60 commits: - Improve Javadoc of ExactConversionsSupport - Merge branch 'master' into primitive-patterns - Update ExactConversionsSupport Javadoc and JDK version - Revert "Update copyright year, javadoc, JDK version" This reverts commit 676af9de90d946f64f34762a6df94dbd91bce41b. - Update copyright year, javadoc, JDK version - Merge branch 'master' into primitive-patterns - Merge branch 'master' into primitive-patterns - Cleanup - Merge branch 'master' into primitive-patterns - Remove trailing spaces - ... and 50 more: https://git.openjdk.org/jdk/compare/c9cacfb2...50cb9832 ------------- Changes: https://git.openjdk.org/jdk/pull/15638/files Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=15638&range=40 Stats: 3272 lines in 41 files changed: 3008 ins; 110 del; 154 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 darcy at openjdk.org Mon Jan 22 21:57:36 2024 From: darcy at openjdk.org (Joe Darcy) Date: Mon, 22 Jan 2024 21:57:36 GMT Subject: RFR: JDK-8175386: Clarify exception behavior of Types utility methods Message-ID: Incremental improvements and clarifications in the specification of Types. ------------- Commit messages: - JDK-8175386: Clarify exception behavior of Types utility methods Changes: https://git.openjdk.org/jdk/pull/17523/files Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=17523&range=00 Issue: https://bugs.openjdk.org/browse/JDK-8175386 Stats: 15 lines in 1 file changed: 14 ins; 0 del; 1 mod Patch: https://git.openjdk.org/jdk/pull/17523.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/17523/head:pull/17523 PR: https://git.openjdk.org/jdk/pull/17523 From darcy at openjdk.org Mon Jan 22 21:57:37 2024 From: darcy at openjdk.org (Joe Darcy) Date: Mon, 22 Jan 2024 21:57:37 GMT Subject: RFR: JDK-8175386: Clarify exception behavior of Types utility methods In-Reply-To: References: Message-ID: On Mon, 22 Jan 2024 21:51:57 GMT, Joe Darcy wrote: > Incremental improvements and clarifications in the specification of Types. More extensive improvements and testing may be done subsequently under JDK-8055219. ------------- PR Comment: https://git.openjdk.org/jdk/pull/17523#issuecomment-1904885634 From prappo at openjdk.org Mon Jan 22 23:05:33 2024 From: prappo at openjdk.org (Pavel Rappo) Date: Mon, 22 Jan 2024 23:05:33 GMT Subject: RFR: JDK-8298405: Support Markdown in Documentation Comments [v7] In-Reply-To: <0pRMUgBnvCfb7DTm_pDnIlmuYdXH8URKFAIk5cT082Y=.f4c324b6-ef98-41b3-9b06-9cb82e03b08f@github.com> References: <0pRMUgBnvCfb7DTm_pDnIlmuYdXH8URKFAIk5cT082Y=.f4c324b6-ef98-41b3-9b06-9cb82e03b08f@github.com> Message-ID: On Fri, 19 Jan 2024 18:37:48 GMT, Jonathan Gibbons wrote: >> Please review a patch to add support for Markdown syntax in documentation comments, as described in the associated JEP. >> >> Notable features: >> >> * support for `///` documentation comments in `JavaTokenizer` >> * new module `jdk.internal.md` -- a private copy of the `commonmark-java` library >> * updates to `DocCommentParser` to treat `///` comments as Markdown >> * updates to the standard doclet to render Markdown comments in HTML > > Jonathan Gibbons has updated the pull request with a new target base due to a merge or a rebase. The pull request now contains eight commits: > > - Merge with upstream/master > - Merge with upstream/master > - Merge remote-tracking branch 'upstream/master' into 8298405.doclet-markdown-v3 > - Address review comments > - Fix whitespace > - Improve handling of embedded inline taglets > - Customize support for Markdown headings > - JDK-8298405: Support Markdown in Documentation Comments src/jdk.compiler/share/classes/com/sun/tools/javac/parser/DocCommentParser.java line 271: > 269: // if (textStart == -1) { > 270: // textStart = bp; > 271: // } What's up with that? src/jdk.compiler/share/classes/com/sun/tools/javac/parser/DocCommentParser.java line 1333: > 1331: lineKind = (ch == '\n' || ch == '\r') ? LineKind.BLANK > 1332: : (indent <= 3) ? peekLineKind() > 1333: : LineKind.OTHER; Nested ternary-s are hard to read. Nested if-s are bulky. Sigh. src/jdk.compiler/share/classes/com/sun/tools/javac/parser/DocCommentParser.java line 1377: > 1375: * @see ATX Headings > 1376: */ > 1377: ATX_HEADER(Pattern.compile("#{1,6}( .*|$)")), Actually, I wonder how accurate those regexes should match spec. Given the definition [^*] of an ATX header and the fact that we always match the complete (not find inside) a line, which by definition should not have line terminators, shouldn't it be like this? #{1,6}([ \t]+.*)? [^*]: The opening sequence of # characters must be followed by spaces or tabs, or by the end of line. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/16388#discussion_r1462039425 PR Review Comment: https://git.openjdk.org/jdk/pull/16388#discussion_r1462213698 PR Review Comment: https://git.openjdk.org/jdk/pull/16388#discussion_r1462148038 From cstein at openjdk.org Tue Jan 23 07:11:37 2024 From: cstein at openjdk.org (Christian Stein) Date: Tue, 23 Jan 2024 07:11:37 GMT Subject: RFR: 8323815: Source launcher should find classes with $ in names Message-ID: Please review this fix to make the multi-file source-code launcher find classes with `$` in names, including names of packages, names of compliation units, and also names of enclosed types. ------------- Commit messages: - 8323815: Source launcher should find classes with $ in names Changes: https://git.openjdk.org/jdk/pull/17526/files Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=17526&range=00 Issue: https://bugs.openjdk.org/browse/JDK-8323815 Stats: 21 lines in 2 files changed: 11 ins; 0 del; 10 mod Patch: https://git.openjdk.org/jdk/pull/17526.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/17526/head:pull/17526 PR: https://git.openjdk.org/jdk/pull/17526 From jlahoda at openjdk.org Tue Jan 23 11:45:28 2024 From: jlahoda at openjdk.org (Jan Lahoda) Date: Tue, 23 Jan 2024 11:45:28 GMT Subject: RFR: 8323515: Create test alias "all" for all test roots [v3] In-Reply-To: <9g7evWB6t3A8WAugPwgIP1gyisNBd1pGT9yFoC_0Z8M=.95b0574e-d163-4911-9c79-b58bf7301f7a@github.com> References: <9g7evWB6t3A8WAugPwgIP1gyisNBd1pGT9yFoC_0Z8M=.95b0574e-d163-4911-9c79-b58bf7301f7a@github.com> Message-ID: On Tue, 16 Jan 2024 09:01:35 GMT, Aleksey Shipilev wrote: >> Since recent work to improve `tier4` performance, we actually test `tier{1,2,3,4}` often, which includes all the tests in current tree. It would be more convenient to just have the `all` test group/alias, so that we can do `make test TEST=all`. This also gives a parallelism / run time benefit, as we do not wait for tests in each tier to complete before moving to next tier. >> >> Sample run on out-of-the-box Linux x86_64 fastdebug is below. For some environments one also needs to supply a few keywords like `!printer` to skip tests that cannot complete without failure due to misconfiguration. I left the keywords as is to show how would a failing run look. There is also an existing shortcut in build system that allows to run this with `make test-all`. >> >> >> % make test TEST=all >> >> Test selection 'all', will run: >> * jtreg:test/hotspot/jtreg:all >> * jtreg:test/jdk:all >> * jtreg:test/langtools:all >> * jtreg:test/jaxp:all >> * jtreg:test/lib-test:all >> >> (...about 6 hours later...) >> >> ============================== >> Test summary >> ============================== >> TEST TOTAL PASS FAIL ERROR >>>> jtreg:test/hotspot/jtreg:all 6731 6702 29 0 << >>>> jtreg:test/jdk:all 9962 9951 11 0 << >> jtreg:test/langtools:all 4469 4469 0 0 >> jtreg:test/jaxp:all 513 513 0 0 >> jtreg:test/lib-test:all 32 32 0 0 >> ============================== >> TEST FAILURE > > Aleksey Shipilev has updated the pull request incrementally with one additional commit since the last revision: > > Catch-all -> All tests I have nothing against it, but I don't think I know enough about details of jtreg configuration to provide approval. OTOH, I personally don't see a strong need for it. ------------- PR Comment: https://git.openjdk.org/jdk/pull/17422#issuecomment-1905864727 From duke at openjdk.org Tue Jan 23 15:32:27 2024 From: duke at openjdk.org (ExE Boss) Date: Tue, 23 Jan 2024 15:32:27 GMT Subject: RFR: 8323815: Source launcher should find classes with $ in names In-Reply-To: References: Message-ID: On Tue, 23 Jan 2024 07:06:41 GMT, Christian Stein wrote: > Please review this fix to make the multi-file source-code launcher find classes with `$` in names, including names of packages, names of compliation units, and also names of enclosed types. > > Tested tier1-3 test/langtools/tools/javac/launcher/MultiFileSourceLauncherTests.java line 89: > 87: """); > 88: var pq = Files.createDirectories(base.resolve("p/q")); > 89: Files.writeString(pq.resolve("Unit$123.java"), Maybe?keep both?tests? ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/17526#discussion_r1463458479 From prappo at openjdk.org Tue Jan 23 15:37:40 2024 From: prappo at openjdk.org (Pavel Rappo) Date: Tue, 23 Jan 2024 15:37:40 GMT Subject: RFR: JDK-8298405: Support Markdown in Documentation Comments [v7] In-Reply-To: <0pRMUgBnvCfb7DTm_pDnIlmuYdXH8URKFAIk5cT082Y=.f4c324b6-ef98-41b3-9b06-9cb82e03b08f@github.com> References: <0pRMUgBnvCfb7DTm_pDnIlmuYdXH8URKFAIk5cT082Y=.f4c324b6-ef98-41b3-9b06-9cb82e03b08f@github.com> Message-ID: <_WLv7XFq2-900uOZFhRJ8rLQmjlFdTlHmC9wVfS6I-Y=.1ada9999-1a0e-4f88-aa67-5d4120585f35@github.com> On Fri, 19 Jan 2024 18:37:48 GMT, Jonathan Gibbons wrote: >> Please review a patch to add support for Markdown syntax in documentation comments, as described in the associated JEP. >> >> Notable features: >> >> * support for `///` documentation comments in `JavaTokenizer` >> * new module `jdk.internal.md` -- a private copy of the `commonmark-java` library >> * updates to `DocCommentParser` to treat `///` comments as Markdown >> * updates to the standard doclet to render Markdown comments in HTML > > Jonathan Gibbons has updated the pull request with a new target base due to a merge or a rebase. The pull request now contains eight commits: > > - Merge with upstream/master > - Merge with upstream/master > - Merge remote-tracking branch 'upstream/master' into 8298405.doclet-markdown-v3 > - Address review comments > - Fix whitespace > - Improve handling of embedded inline taglets > - Customize support for Markdown headings > - JDK-8298405: Support Markdown in Documentation Comments src/jdk.compiler/share/classes/com/sun/tools/javac/parser/DocCommentParser.java line 225: > 223: while (ch == ' ' && bp < buflen) { > 224: nextChar(); > 225: } Why do we specifically care about `\s` symbols here rather than about broader whitespace? src/jdk.compiler/share/classes/com/sun/tools/javac/parser/DocCommentParser.java line 1165: > 1163: } > 1164: > 1165: Please delete this blank line. src/jdk.compiler/share/classes/com/sun/tools/javac/parser/DocCommentParser.java line 1315: > 1313: } > 1314: > 1315: void skipLine() { Like `peekLike()`, this method also does not seem to be consistent with `newline` in `nextChar()`. src/jdk.compiler/share/classes/com/sun/tools/javac/parser/DocCommentParser.java line 1382: > 1380: * @see Setext Headings > 1381: */ > 1382: SETEXT_UNDERLINE(Pattern.compile("[=-]+[ \t]*")), This should be more accurate: Suggestion: SETEXT_UNDERLINE(Pattern.compile("=+|-+[ \t]*")), src/jdk.compiler/share/classes/com/sun/tools/javac/parser/DocCommentParser.java line 1388: > 1386: * @see Thematic Break > 1387: */ > 1388: THEMATIC_BREAK(Pattern.compile("((\\+[ \t]*+){3,})|((-[ \t]*+){3,})|((_[ \t]*+){3,})")), Suggestion: /** * Thematic break: a line of * - _ interspersed with optional spaces and tabs * @see Thematic Break */ THEMATIC_BREAK(Pattern.compile("((\*[ \t]*+){3,})|((-[ \t]*+){3,})|((_[ \t]*+){3,})")), src/jdk.compiler/share/classes/com/sun/tools/javac/parser/DocCommentParser.java line 1396: > 1394: * @see Code Fence > 1395: */ > 1396: CODE_FENCE(Pattern.compile("(`{3,}[^`]*+)|(~{3,}.*+)")), Why are this and the previous patterns possessive (`+`), while others aren't? src/jdk.compiler/share/classes/com/sun/tools/javac/parser/DocCommentParser.java line 1419: > 1417: LineKind peekLineKind() { > 1418: switch (ch) { > 1419: case '#', '=', '-', '+', '_', '`', '~' -> { This change is to match that of `THEMATIC_BREAK`: Suggestion: case '#', '=', '-', '*', '_', '`', '~' -> { src/jdk.compiler/share/classes/com/sun/tools/javac/parser/JavaTokenizer.java line 1065: > 1063: > 1064: if (accept('/')) { // (Spec. 3.7) > 1065: if (accept('/')) { // Markdown comment Here and elsewhere in this file: do we need to mention Markdown? src/jdk.compiler/share/classes/com/sun/tools/javac/parser/JavaTokenizer.java line 1553: > 1551: > 1552: /** > 1553: * Determine how much indent to remove from markdown comment. Suggestion: * Determine how much indent to remove from Markdown comment. src/jdk.compiler/share/classes/com/sun/tools/javac/parser/JavaTokenizer.java line 1585: > 1583: */ > 1584: UnicodeReader trimMarkdownComment(UnicodeReader line, int indent) { > 1585: int pos = line.position(); Unused. src/jdk.compiler/share/classes/com/sun/tools/javac/parser/ParserFactory.java line 30: > 28: import java.util.Locale; > 29: > 30: import com.sun.source.util.DocTrees; Unused. src/jdk.compiler/share/classes/com/sun/tools/javac/tree/DocPretty.java line 35: > 33: import com.sun.source.doctree.*; > 34: import com.sun.source.doctree.AttributeTree.ValueKind; > 35: import com.sun.source.util.DocTreeScanner; Unused. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/16388#discussion_r1463169245 PR Review Comment: https://git.openjdk.org/jdk/pull/16388#discussion_r1463155900 PR Review Comment: https://git.openjdk.org/jdk/pull/16388#discussion_r1463252506 PR Review Comment: https://git.openjdk.org/jdk/pull/16388#discussion_r1463181845 PR Review Comment: https://git.openjdk.org/jdk/pull/16388#discussion_r1463202143 PR Review Comment: https://git.openjdk.org/jdk/pull/16388#discussion_r1463237327 PR Review Comment: https://git.openjdk.org/jdk/pull/16388#discussion_r1463239667 PR Review Comment: https://git.openjdk.org/jdk/pull/16388#discussion_r1463422663 PR Review Comment: https://git.openjdk.org/jdk/pull/16388#discussion_r1463422992 PR Review Comment: https://git.openjdk.org/jdk/pull/16388#discussion_r1463424623 PR Review Comment: https://git.openjdk.org/jdk/pull/16388#discussion_r1463437420 PR Review Comment: https://git.openjdk.org/jdk/pull/16388#discussion_r1463441675 From cstein at openjdk.org Tue Jan 23 15:41:33 2024 From: cstein at openjdk.org (Christian Stein) Date: Tue, 23 Jan 2024 15:41:33 GMT Subject: RFR: 8323815: Source launcher should find classes with $ in names In-Reply-To: References: Message-ID: On Tue, 23 Jan 2024 15:30:14 GMT, ExE Boss wrote: >> Please review this fix to make the multi-file source-code launcher find classes with `$` in names, including names of packages, names of compliation units, and also names of enclosed types. >> >> Tested tier1-3 > > test/langtools/tools/javac/launcher/MultiFileSourceLauncherTests.java line 89: > >> 87: """); >> 88: var pq = Files.createDirectories(base.resolve("p/q")); >> 89: Files.writeString(pq.resolve("Unit$123.java"), > > Maybe?keep both?tests? There are plenty tests for canonically named compilation units, thus that wouldn't carry much extra worth. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/17526#discussion_r1463479105 From shade at openjdk.org Tue Jan 23 15:43:35 2024 From: shade at openjdk.org (Aleksey Shipilev) Date: Tue, 23 Jan 2024 15:43:35 GMT Subject: RFR: 8323515: Create test alias "all" for all test roots [v3] In-Reply-To: <9g7evWB6t3A8WAugPwgIP1gyisNBd1pGT9yFoC_0Z8M=.95b0574e-d163-4911-9c79-b58bf7301f7a@github.com> References: <9g7evWB6t3A8WAugPwgIP1gyisNBd1pGT9yFoC_0Z8M=.95b0574e-d163-4911-9c79-b58bf7301f7a@github.com> Message-ID: On Tue, 16 Jan 2024 09:01:35 GMT, Aleksey Shipilev wrote: >> Since recent work to improve `tier4` performance, we actually test `tier{1,2,3,4}` often, which includes all the tests in current tree. It would be more convenient to just have the `all` test group/alias, so that we can do `make test TEST=all`. This also gives a parallelism / run time benefit, as we do not wait for tests in each tier to complete before moving to next tier. >> >> Sample run on out-of-the-box Linux x86_64 fastdebug is below. For some environments one also needs to supply a few keywords like `!printer` to skip tests that cannot complete without failure due to misconfiguration. I left the keywords as is to show how would a failing run look. There is also an existing shortcut in build system that allows to run this with `make test-all`. >> >> >> % make test TEST=all >> >> Test selection 'all', will run: >> * jtreg:test/hotspot/jtreg:all >> * jtreg:test/jdk:all >> * jtreg:test/langtools:all >> * jtreg:test/jaxp:all >> * jtreg:test/lib-test:all >> >> (...about 6 hours later...) >> >> ============================== >> Test summary >> ============================== >> TEST TOTAL PASS FAIL ERROR >>>> jtreg:test/hotspot/jtreg:all 6731 6702 29 0 << >>>> jtreg:test/jdk:all 9962 9951 11 0 << >> jtreg:test/langtools:all 4469 4469 0 0 >> jtreg:test/jaxp:all 513 513 0 0 >> jtreg:test/lib-test:all 32 32 0 0 >> ============================== >> TEST FAILURE > > Aleksey Shipilev has updated the pull request incrementally with one additional commit since the last revision: > > Catch-all -> All tests All right, thanks! @lmesnik, I realized I forgot to ask if you had objections to this. ------------- PR Comment: https://git.openjdk.org/jdk/pull/17422#issuecomment-1906338893 From lmesnik at openjdk.org Tue Jan 23 16:59:28 2024 From: lmesnik at openjdk.org (Leonid Mesnik) Date: Tue, 23 Jan 2024 16:59:28 GMT Subject: RFR: 8323515: Create test alias "all" for all test roots [v3] In-Reply-To: <9g7evWB6t3A8WAugPwgIP1gyisNBd1pGT9yFoC_0Z8M=.95b0574e-d163-4911-9c79-b58bf7301f7a@github.com> References: <9g7evWB6t3A8WAugPwgIP1gyisNBd1pGT9yFoC_0Z8M=.95b0574e-d163-4911-9c79-b58bf7301f7a@github.com> Message-ID: On Tue, 16 Jan 2024 09:01:35 GMT, Aleksey Shipilev wrote: >> Since recent work to improve `tier4` performance, we actually test `tier{1,2,3,4}` often, which includes all the tests in current tree. It would be more convenient to just have the `all` test group/alias, so that we can do `make test TEST=all`. This also gives a parallelism / run time benefit, as we do not wait for tests in each tier to complete before moving to next tier. >> >> Sample run on out-of-the-box Linux x86_64 fastdebug is below. For some environments one also needs to supply a few keywords like `!printer` to skip tests that cannot complete without failure due to misconfiguration. I left the keywords as is to show how would a failing run look. There is also an existing shortcut in build system that allows to run this with `make test-all`. >> >> >> % make test TEST=all >> >> Test selection 'all', will run: >> * jtreg:test/hotspot/jtreg:all >> * jtreg:test/jdk:all >> * jtreg:test/langtools:all >> * jtreg:test/jaxp:all >> * jtreg:test/lib-test:all >> >> (...about 6 hours later...) >> >> ============================== >> Test summary >> ============================== >> TEST TOTAL PASS FAIL ERROR >>>> jtreg:test/hotspot/jtreg:all 6731 6702 29 0 << >>>> jtreg:test/jdk:all 9962 9951 11 0 << >> jtreg:test/langtools:all 4469 4469 0 0 >> jtreg:test/jaxp:all 513 513 0 0 >> jtreg:test/lib-test:all 32 32 0 0 >> ============================== >> TEST FAILURE > > Aleksey Shipilev has updated the pull request incrementally with one additional commit since the last revision: > > Catch-all -> All tests Marked as reviewed by lmesnik (Reviewer). ------------- PR Review: https://git.openjdk.org/jdk/pull/17422#pullrequestreview-1839361504 From shade at openjdk.org Tue Jan 23 17:06:38 2024 From: shade at openjdk.org (Aleksey Shipilev) Date: Tue, 23 Jan 2024 17:06:38 GMT Subject: RFR: 8323515: Create test alias "all" for all test roots [v3] In-Reply-To: <9g7evWB6t3A8WAugPwgIP1gyisNBd1pGT9yFoC_0Z8M=.95b0574e-d163-4911-9c79-b58bf7301f7a@github.com> References: <9g7evWB6t3A8WAugPwgIP1gyisNBd1pGT9yFoC_0Z8M=.95b0574e-d163-4911-9c79-b58bf7301f7a@github.com> Message-ID: On Tue, 16 Jan 2024 09:01:35 GMT, Aleksey Shipilev wrote: >> Since recent work to improve `tier4` performance, we actually test `tier{1,2,3,4}` often, which includes all the tests in current tree. It would be more convenient to just have the `all` test group/alias, so that we can do `make test TEST=all`. This also gives a parallelism / run time benefit, as we do not wait for tests in each tier to complete before moving to next tier. >> >> Sample run on out-of-the-box Linux x86_64 fastdebug is below. For some environments one also needs to supply a few keywords like `!printer` to skip tests that cannot complete without failure due to misconfiguration. I left the keywords as is to show how would a failing run look. There is also an existing shortcut in build system that allows to run this with `make test-all`. >> >> >> % make test TEST=all >> >> Test selection 'all', will run: >> * jtreg:test/hotspot/jtreg:all >> * jtreg:test/jdk:all >> * jtreg:test/langtools:all >> * jtreg:test/jaxp:all >> * jtreg:test/lib-test:all >> >> (...about 6 hours later...) >> >> ============================== >> Test summary >> ============================== >> TEST TOTAL PASS FAIL ERROR >>>> jtreg:test/hotspot/jtreg:all 6731 6702 29 0 << >>>> jtreg:test/jdk:all 9962 9951 11 0 << >> jtreg:test/langtools:all 4469 4469 0 0 >> jtreg:test/jaxp:all 513 513 0 0 >> jtreg:test/lib-test:all 32 32 0 0 >> ============================== >> TEST FAILURE > > Aleksey Shipilev has updated the pull request incrementally with one additional commit since the last revision: > > Catch-all -> All tests Thank you all! ------------- PR Comment: https://git.openjdk.org/jdk/pull/17422#issuecomment-1906520760 From shade at openjdk.org Tue Jan 23 17:06:40 2024 From: shade at openjdk.org (Aleksey Shipilev) Date: Tue, 23 Jan 2024 17:06:40 GMT Subject: Integrated: 8323515: Create test alias "all" for all test roots In-Reply-To: References: Message-ID: On Mon, 15 Jan 2024 11:05:09 GMT, Aleksey Shipilev wrote: > Since recent work to improve `tier4` performance, we actually test `tier{1,2,3,4}` often, which includes all the tests in current tree. It would be more convenient to just have the `all` test group/alias, so that we can do `make test TEST=all`. This also gives a parallelism / run time benefit, as we do not wait for tests in each tier to complete before moving to next tier. > > Sample run on out-of-the-box Linux x86_64 fastdebug is below. For some environments one also needs to supply a few keywords like `!printer` to skip tests that cannot complete without failure due to misconfiguration. I left the keywords as is to show how would a failing run look. There is also an existing shortcut in build system that allows to run this with `make test-all`. > > > % make test TEST=all > > Test selection 'all', will run: > * jtreg:test/hotspot/jtreg:all > * jtreg:test/jdk:all > * jtreg:test/langtools:all > * jtreg:test/jaxp:all > * jtreg:test/lib-test:all > > (...about 6 hours later...) > > ============================== > Test summary > ============================== > TEST TOTAL PASS FAIL ERROR >>> jtreg:test/hotspot/jtreg:all 6731 6702 29 0 << >>> jtreg:test/jdk:all 9962 9951 11 0 << > jtreg:test/langtools:all 4469 4469 0 0 > jtreg:test/jaxp:all 513 513 0 0 > jtreg:test/lib-test:all 32 32 0 0 > ============================== > TEST FAILURE This pull request has now been integrated. Changeset: 8b9bf758 Author: Aleksey Shipilev URL: https://git.openjdk.org/jdk/commit/8b9bf758801400e4491326cd4c90fc117b9d97e1 Stats: 49 lines in 5 files changed: 42 ins; 5 del; 2 mod 8323515: Create test alias "all" for all test roots Reviewed-by: dholmes, alanb, joehw, lmesnik ------------- PR: https://git.openjdk.org/jdk/pull/17422 From jjg at openjdk.org Wed Jan 24 00:03:39 2024 From: jjg at openjdk.org (Jonathan Gibbons) Date: Wed, 24 Jan 2024 00:03:39 GMT Subject: RFR: JDK-8042981: Strip type annotations in Types' utility methods [v2] In-Reply-To: References: Message-ID: On Thu, 22 Sep 2022 16:50:45 GMT, Liam Miller-Cushon wrote: >> Joe Darcy 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 three additional commits since the last revision: >> >> - Update visitor; all langtools regression tests pass. >> - Merge branch 'master' into JDK-8042981 >> - JDK-8042981: Strip type annotations in Types' utility methods > > src/java.compiler/share/classes/javax/lang/model/util/Types.java line 40: > >> 38: * Where a method returns a type mirror or a collection of type >> 39: * mirrors, any type mirrors represent types with no type annotations, >> 40: * unless otherwise indicated. > > I'm seeing `erasure` preserve type annotations on the array type (but not its component) after this change: `erasure(@A int @B []) = int @B []`. (Here's the [repro](https://gist.github.com/cushon/e0a59cc291c3b83204b9139addb01340).) > > Is that deliberate, or is this still work in progress? @jdarcy ? ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/8984#discussion_r1464130816 From cushon at openjdk.org Wed Jan 24 00:03:40 2024 From: cushon at openjdk.org (Liam Miller-Cushon) Date: Wed, 24 Jan 2024 00:03:40 GMT Subject: RFR: JDK-8042981: Strip type annotations in Types' utility methods [v2] In-Reply-To: References: Message-ID: On Tue, 23 Jan 2024 23:55:30 GMT, Jonathan Gibbons wrote: >> src/java.compiler/share/classes/javax/lang/model/util/Types.java line 40: >> >>> 38: * Where a method returns a type mirror or a collection of type >>> 39: * mirrors, any type mirrors represent types with no type annotations, >>> 40: * unless otherwise indicated. >> >> I'm seeing `erasure` preserve type annotations on the array type (but not its component) after this change: `erasure(@A int @B []) = int @B []`. (Here's the [repro](https://gist.github.com/cushon/e0a59cc291c3b83204b9139addb01340).) >> >> Is that deliberate, or is this still work in progress? > > @jdarcy ? (This comment is obsolete, it was on a much earlier version of the PR, and these issues have been addressed. The latest version correct handles removing annotations from contained types. There's some discussion about the issues with the earlier approach in https://github.com/openjdk/jdk/pull/8984#issuecomment-1806211798) ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/8984#discussion_r1464132270 From jjg at openjdk.org Wed Jan 24 00:03:42 2024 From: jjg at openjdk.org (Jonathan Gibbons) Date: Wed, 24 Jan 2024 00:03:42 GMT Subject: RFR: JDK-8042981: Strip type annotations in Types' utility methods [v2] In-Reply-To: References: Message-ID: On Wed, 21 Sep 2022 11:21:27 GMT, Jan Lahoda wrote: >> Joe Darcy 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 three additional commits since the last revision: >> >> - Update visitor; all langtools regression tests pass. >> - Merge branch 'master' into JDK-8042981 >> - JDK-8042981: Strip type annotations in Types' utility methods > > src/java.compiler/share/classes/javax/lang/model/util/Types.java line 241: > >> 239: * @param extendsBound the extends (upper) bound, or {@code null} if none >> 240: * @param superBound the super (lower) bound, or {@code null} if none >> 241: * @throws IllegalArgumentException if bounds are not valid > > Should annotation also be preserved (and also documented to be preserved) for `getDeclaredType`? @jddarcy ? ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/8984#discussion_r1464131446 From jjg at openjdk.org Wed Jan 24 00:03:45 2024 From: jjg at openjdk.org (Jonathan Gibbons) Date: Wed, 24 Jan 2024 00:03:45 GMT Subject: RFR: JDK-8042981: Strip type annotations in Types' utility methods [v12] In-Reply-To: References: Message-ID: On Sat, 20 Jan 2024 21:59:46 GMT, Joe Darcy wrote: >> Early review for JDK-8042981: "Strip type annotations in Types' utility methods". I work more often in the Element world rather than the Type word of the annotation processing APIs. >> >> The type annotations on primitive types are *not* cleared by the existing annotation clearing mechanisms. I suspect Type.Visitor is missing a case for primitive types. Someone with familiarity with javac's type modeling should take a look; thanks. > > Joe Darcy has updated the pull request incrementally with one additional commit since the last revision: > > Make make of stripAnnotations more explicit. src/jdk.compiler/share/classes/com/sun/tools/javac/code/Type.java line 431: > 429: /** > 430: * Note: this visitor only needs to handle cases where 'contained' > 431: * types can be annotated. These cases are described ing JVMS typo: `ing` test/langtools/tools/javac/processing/model/util/types/TestAnnotationStripping.java line 145: > 143: try { > 144: var result = vacuousTypes.stripAnnotations(tm); > 145: messager.printError("Unexpected non-exceptional result returned" + result); maybe need a space at the end of the string, to separate "returned" from `result` ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/8984#discussion_r1464131301 PR Review Comment: https://git.openjdk.org/jdk/pull/8984#discussion_r1464133221 From jjg at openjdk.org Wed Jan 24 00:07:31 2024 From: jjg at openjdk.org (Jonathan Gibbons) Date: Wed, 24 Jan 2024 00:07:31 GMT Subject: RFR: JDK-8042981: Strip type annotations in Types' utility methods [v2] In-Reply-To: References: Message-ID: On Tue, 23 Jan 2024 23:58:32 GMT, Liam Miller-Cushon wrote: >> @jdarcy ? > > (This comment is obsolete, it was on a much earlier version of the PR, and these issues have been addressed. The latest version correct handles removing annotations from contained types. There's some discussion about the issues with the earlier approach in https://github.com/openjdk/jdk/pull/8984#issuecomment-1806211798) > (This comment is obsolete, it was on a much earlier version of the PR, and these issues have been addressed. The latest version correct handles removing annotations from contained types. There's some discussion about the issues with the earlier approach in [#8984 (comment)](https://github.com/openjdk/jdk/pull/8984#issuecomment-1806211798)) Thanks, I guess I was confused by the different forms of the PR. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/8984#discussion_r1464135431 From jjg at openjdk.org Wed Jan 24 00:14:27 2024 From: jjg at openjdk.org (Jonathan Gibbons) Date: Wed, 24 Jan 2024 00:14:27 GMT Subject: RFR: JDK-8175386: Clarify exception behavior of Types utility methods In-Reply-To: References: Message-ID: On Mon, 22 Jan 2024 21:51:57 GMT, Joe Darcy wrote: > Incremental improvements and clarifications in the specification of Types. Fix duplicate entry src/java.compiler/share/classes/javax/lang/model/util/Types.java line 46: > 44: * {@linkplain TypeKind#PACKAGE packages} and {@linkplain > 45: * TypeKind#MODULE modules} are generally out of scope for these > 46: * methods. Do you want to better specify the behavior for the "out of scope" types, such as _Unless otherwise specified, `IllegalArgumenntException` will be thrown when a method is called with an inappropriate argument._ src/java.compiler/share/classes/javax/lang/model/util/Types.java line 252: > 250: * @param componentType the component type > 251: * @throws IllegalArgumentException if the component type is not valid for > 252: * an array, including executable, package, module, executable, and wildcard types duplicate `executable` ------------- Changes requested by jjg (Reviewer). PR Review: https://git.openjdk.org/jdk/pull/17523#pullrequestreview-1840154314 PR Review Comment: https://git.openjdk.org/jdk/pull/17523#discussion_r1464139144 PR Review Comment: https://git.openjdk.org/jdk/pull/17523#discussion_r1464139289 From darcy at openjdk.org Wed Jan 24 01:03:37 2024 From: darcy at openjdk.org (Joe Darcy) Date: Wed, 24 Jan 2024 01:03:37 GMT Subject: RFR: JDK-8175386: Clarify exception behavior of Types utility methods [v2] In-Reply-To: References: Message-ID: > Incremental improvements and clarifications in the specification of Types. Joe Darcy has updated the pull request incrementally with one additional commit since the last revision: Fix typo found in code review. ------------- Changes: - all: https://git.openjdk.org/jdk/pull/17523/files - new: https://git.openjdk.org/jdk/pull/17523/files/bdd28dc1..1f327589 Webrevs: - full: https://webrevs.openjdk.org/?repo=jdk&pr=17523&range=01 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=17523&range=00-01 Stats: 1 line in 1 file changed: 0 ins; 0 del; 1 mod Patch: https://git.openjdk.org/jdk/pull/17523.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/17523/head:pull/17523 PR: https://git.openjdk.org/jdk/pull/17523 From darcy at openjdk.org Wed Jan 24 01:03:39 2024 From: darcy at openjdk.org (Joe Darcy) Date: Wed, 24 Jan 2024 01:03:39 GMT Subject: RFR: JDK-8175386: Clarify exception behavior of Types utility methods [v2] In-Reply-To: References: Message-ID: On Wed, 24 Jan 2024 00:11:32 GMT, Jonathan Gibbons wrote: >> Joe Darcy has updated the pull request incrementally with one additional commit since the last revision: >> >> Fix typo found in code review. > > src/java.compiler/share/classes/javax/lang/model/util/Types.java line 252: > >> 250: * @param componentType the component type >> 251: * @throws IllegalArgumentException if the component type is not valid for >> 252: * an array, including executable, package, module, executable, and wildcard types > > duplicate `executable` Fixed; thanks. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/17523#discussion_r1464173043 From darcy at openjdk.org Wed Jan 24 01:12:39 2024 From: darcy at openjdk.org (Joe Darcy) Date: Wed, 24 Jan 2024 01:12:39 GMT Subject: RFR: JDK-8175386: Clarify exception behavior of Types utility methods [v3] In-Reply-To: References: Message-ID: > Incremental improvements and clarifications in the specification of Types. Joe Darcy has updated the pull request incrementally with one additional commit since the last revision: Implement review feedback. ------------- Changes: - all: https://git.openjdk.org/jdk/pull/17523/files - new: https://git.openjdk.org/jdk/pull/17523/files/1f327589..9aa3b2fa Webrevs: - full: https://webrevs.openjdk.org/?repo=jdk&pr=17523&range=02 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=17523&range=01-02 Stats: 4 lines in 1 file changed: 2 ins; 0 del; 2 mod Patch: https://git.openjdk.org/jdk/pull/17523.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/17523/head:pull/17523 PR: https://git.openjdk.org/jdk/pull/17523 From darcy at openjdk.org Wed Jan 24 01:12:40 2024 From: darcy at openjdk.org (Joe Darcy) Date: Wed, 24 Jan 2024 01:12:40 GMT Subject: RFR: JDK-8175386: Clarify exception behavior of Types utility methods [v3] In-Reply-To: References: Message-ID: <85ae2sVlZcOy8LnOUMW0pA6pi-0koXlBcTBeHeMgNso=.5e3d3d3a-e739-47ae-ac3d-76a51a4ec984@github.com> On Wed, 24 Jan 2024 00:11:13 GMT, Jonathan Gibbons wrote: >> Joe Darcy has updated the pull request incrementally with one additional commit since the last revision: >> >> Implement review feedback. > > src/java.compiler/share/classes/javax/lang/model/util/Types.java line 46: > >> 44: * {@linkplain TypeKind#PACKAGE packages} and {@linkplain >> 45: * TypeKind#MODULE modules} are generally out of scope for these >> 46: * methods. > > Do you want to better specify the behavior for the "out of scope" types, such as _Unless otherwise specified, `IllegalArgumenntException` will be thrown when a method is called with an inappropriate argument._ Good suggestion; blanket statement added. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/17523#discussion_r1464179932 From darcy at openjdk.org Wed Jan 24 01:28:30 2024 From: darcy at openjdk.org (Joe Darcy) Date: Wed, 24 Jan 2024 01:28:30 GMT Subject: RFR: JDK-8042981: Strip type annotations in Types' utility methods [v2] In-Reply-To: References: Message-ID: <7COyJ1b5X_1Z6ZlMJ-LaG8jxOlY6n9qwNWJ8Ry0uvFY=.72cd939d-b535-4114-a312-a70342cd8b6e@github.com> On Tue, 23 Jan 2024 23:56:47 GMT, Jonathan Gibbons wrote: >> src/java.compiler/share/classes/javax/lang/model/util/Types.java line 241: >> >>> 239: * @param extendsBound the extends (upper) bound, or {@code null} if none >>> 240: * @param superBound the super (lower) bound, or {@code null} if none >>> 241: * @throws IllegalArgumentException if bounds are not valid >> >> Should annotation also be preserved (and also documented to be preserved) for `getDeclaredType`? > > @jddarcy ? I don't think it is preserved in that case as much as a lookup/construction process is done based on the TypeElement, etc. So I think leaving the annotation behavior unspecified is okay. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/8984#discussion_r1464190452 From darcy at openjdk.org Wed Jan 24 01:34:43 2024 From: darcy at openjdk.org (Joe Darcy) Date: Wed, 24 Jan 2024 01:34:43 GMT Subject: RFR: JDK-8042981: Strip type annotations in Types' utility methods [v13] In-Reply-To: References: Message-ID: > Early review for JDK-8042981: "Strip type annotations in Types' utility methods". I work more often in the Element world rather than the Type word of the annotation processing APIs. > > The type annotations on primitive types are *not* cleared by the existing annotation clearing mechanisms. I suspect Type.Visitor is missing a case for primitive types. Someone with familiarity with javac's type modeling should take a look; thanks. Joe Darcy has updated the pull request incrementally with two additional commits since the last revision: - Fix issue found in code review. - Fix typo found in code review. ------------- Changes: - all: https://git.openjdk.org/jdk/pull/8984/files - new: https://git.openjdk.org/jdk/pull/8984/files/450ae6b2..0003be28 Webrevs: - full: https://webrevs.openjdk.org/?repo=jdk&pr=8984&range=12 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=8984&range=11-12 Stats: 5 lines in 2 files changed: 0 ins; 0 del; 5 mod Patch: https://git.openjdk.org/jdk/pull/8984.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/8984/head:pull/8984 PR: https://git.openjdk.org/jdk/pull/8984 From darcy at openjdk.org Wed Jan 24 01:34:46 2024 From: darcy at openjdk.org (Joe Darcy) Date: Wed, 24 Jan 2024 01:34:46 GMT Subject: RFR: JDK-8042981: Strip type annotations in Types' utility methods [v12] In-Reply-To: References: Message-ID: On Tue, 23 Jan 2024 23:56:32 GMT, Jonathan Gibbons wrote: >> Joe Darcy has updated the pull request incrementally with one additional commit since the last revision: >> >> Make make of stripAnnotations more explicit. > > src/jdk.compiler/share/classes/com/sun/tools/javac/code/Type.java line 431: > >> 429: /** >> 430: * Note: this visitor only needs to handle cases where 'contained' >> 431: * types can be annotated. These cases are described ing JVMS > > typo: `ing` Fixed. > test/langtools/tools/javac/processing/model/util/types/TestAnnotationStripping.java line 145: > >> 143: try { >> 144: var result = vacuousTypes.stripAnnotations(tm); >> 145: messager.printError("Unexpected non-exceptional result returned" + result); > > maybe need a space at the end of the string, to separate "returned" from `result` Good catch. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/8984#discussion_r1464192117 PR Review Comment: https://git.openjdk.org/jdk/pull/8984#discussion_r1464193353 From vromero at openjdk.org Wed Jan 24 04:00:37 2024 From: vromero at openjdk.org (Vicente Romero) Date: Wed, 24 Jan 2024 04:00:37 GMT Subject: RFR: 8303374: Compiler Implementation for Primitive types in patterns, instanceof, and switch (Preview) [v41] In-Reply-To: References: <4GCkSMggtYI8KnM-kELHez3Nd42WIrfd6jOF1bbK5PA=.12aec6f3-669b-4675-ad34-ffe28cb23459@github.com> Message-ID: On Mon, 22 Jan 2024 18:42:56 GMT, Aggelos Biboudis wrote: >> 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 60 commits: > > - Improve Javadoc of ExactConversionsSupport > - Merge branch 'master' into primitive-patterns > - Update ExactConversionsSupport Javadoc and JDK version > - Revert "Update copyright year, javadoc, JDK version" > > This reverts commit 676af9de90d946f64f34762a6df94dbd91bce41b. > - Update copyright year, javadoc, JDK version > - Merge branch 'master' into primitive-patterns > - Merge branch 'master' into primitive-patterns > - Cleanup > - Merge branch 'master' into primitive-patterns > - Remove trailing spaces > - ... and 50 more: https://git.openjdk.org/jdk/compare/c9cacfb2...50cb9832 src/java.base/share/classes/java/lang/runtime/SwitchBootstraps.java line 72: > 70: private static final Object SENTINEL = new Object(); > 71: private static final MethodHandles.Lookup LOOKUP = MethodHandles.lookup(); > 72: private static final boolean previewEnabled = true; not sure about the use of this constant, do we really need it? ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/15638#discussion_r1464262036 From darcy at openjdk.org Wed Jan 24 06:08:44 2024 From: darcy at openjdk.org (Joe Darcy) Date: Wed, 24 Jan 2024 06:08:44 GMT Subject: RFR: JDK-8042981: Strip type annotations in Types' utility methods [v14] In-Reply-To: References: Message-ID: > Early review for JDK-8042981: "Strip type annotations in Types' utility methods". I work more often in the Element world rather than the Type word of the annotation processing APIs. > > The type annotations on primitive types are *not* cleared by the existing annotation clearing mechanisms. I suspect Type.Visitor is missing a case for primitive types. Someone with familiarity with javac's type modeling should take a look; thanks. Joe Darcy has updated the pull request incrementally with one additional commit since the last revision: Better describe intentions of stripAnnotations method. ------------- Changes: - all: https://git.openjdk.org/jdk/pull/8984/files - new: https://git.openjdk.org/jdk/pull/8984/files/0003be28..aa9154b2 Webrevs: - full: https://webrevs.openjdk.org/?repo=jdk&pr=8984&range=13 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=8984&range=12-13 Stats: 9 lines in 1 file changed: 8 ins; 0 del; 1 mod Patch: https://git.openjdk.org/jdk/pull/8984.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/8984/head:pull/8984 PR: https://git.openjdk.org/jdk/pull/8984 From jlahoda at openjdk.org Wed Jan 24 08:18:27 2024 From: jlahoda at openjdk.org (Jan Lahoda) Date: Wed, 24 Jan 2024 08:18:27 GMT Subject: RFR: 8323815: Source launcher should find classes with $ in names In-Reply-To: References: Message-ID: On Tue, 23 Jan 2024 07:06:41 GMT, Christian Stein wrote: > Please review this fix to make the multi-file source-code launcher find classes with `$` in names, including names of packages, names of compliation units, and also names of enclosed types. > > Tested tier1-3 I think the code is OK, but I'd suggest to add a few more tests to help ensure the behavior is kept even in case the code is modified. test/langtools/tools/javac/launcher/MultiFileSourceLauncherTests.java line 78: > 76: public static void main(String... args) throws Exception { > 77: System.out.println(Class.forName("World$Core")); > 78: System.out.println(Class.forName("p.q.Unit$123$Fir$t$$econd")); I think I would suggest two more tests: - one that would (in a separate run) lookup `p.q.Unit$123$Fir$t` (to ensure the search is broad enough) - one with a package name with `$`. ------------- PR Review: https://git.openjdk.org/jdk/pull/17526#pullrequestreview-1840696005 PR Review Comment: https://git.openjdk.org/jdk/pull/17526#discussion_r1464477154 From jlahoda at openjdk.org Wed Jan 24 10:29:35 2024 From: jlahoda at openjdk.org (Jan Lahoda) Date: Wed, 24 Jan 2024 10:29:35 GMT Subject: RFR: 8303374: Compiler Implementation for Primitive types in patterns, instanceof, and switch (Preview) [v41] In-Reply-To: References: <4GCkSMggtYI8KnM-kELHez3Nd42WIrfd6jOF1bbK5PA=.12aec6f3-669b-4675-ad34-ffe28cb23459@github.com> Message-ID: <01zQgnrUk9UigmTRH4Zijckme2pKW4gUsKMzhlGorsc=.2bb5c607-644b-457d-b8d6-e1f9b6a84025@github.com> On Wed, 24 Jan 2024 03:47:06 GMT, Vicente Romero wrote: >> Aggelos Biboudis has updated the pull request with a new target base due to a merge or a rebase. The pull request now contains 60 commits: >> >> - Improve Javadoc of ExactConversionsSupport >> - Merge branch 'master' into primitive-patterns >> - Update ExactConversionsSupport Javadoc and JDK version >> - Revert "Update copyright year, javadoc, JDK version" >> >> This reverts commit 676af9de90d946f64f34762a6df94dbd91bce41b. >> - Update copyright year, javadoc, JDK version >> - Merge branch 'master' into primitive-patterns >> - Merge branch 'master' into primitive-patterns >> - Cleanup >> - Merge branch 'master' into primitive-patterns >> - Remove trailing spaces >> - ... and 50 more: https://git.openjdk.org/jdk/compare/c9cacfb2...50cb9832 > > src/java.base/share/classes/java/lang/runtime/SwitchBootstraps.java line 72: > >> 70: private static final Object SENTINEL = new Object(); >> 71: private static final MethodHandles.Lookup LOOKUP = MethodHandles.lookup(); >> 72: private static final boolean previewEnabled = true; > > not sure about the use of this constant, do we really need it? Uh, I think this is a good catch. I am not completely sure what the policy is, but here we are enhancing a non-preview method with some preview-based behavior. I would feel better if the method would refuse to work in the preview way when preview is not enabled. I.e. my opinion is that this should either be initialized to `jdk.internal.misc.PreviewFeatures.isEnabled()`, or `jdk.internal.misc.PreviewFeatures.ensureEnabled()` should be used appropriately. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/15638#discussion_r1464693259 From abimpoudis at openjdk.org Wed Jan 24 11:53:52 2024 From: abimpoudis at openjdk.org (Aggelos Biboudis) Date: Wed, 24 Jan 2024 11:53:52 GMT Subject: RFR: 8303374: Compiler Implementation for Primitive types in patterns, instanceof, and switch (Preview) [v42] 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 incrementally with one additional commit since the last revision: Set previewEnabled properly in SwitchBootstraps ------------- Changes: - all: https://git.openjdk.org/jdk/pull/15638/files - new: https://git.openjdk.org/jdk/pull/15638/files/50cb9832..663c7a54 Webrevs: - full: https://webrevs.openjdk.org/?repo=jdk&pr=15638&range=41 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=15638&range=40-41 Stats: 3 lines in 1 file changed: 1 ins; 1 del; 1 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 Wed Jan 24 11:53:54 2024 From: abimpoudis at openjdk.org (Aggelos Biboudis) Date: Wed, 24 Jan 2024 11:53:54 GMT Subject: RFR: 8303374: Compiler Implementation for Primitive types in patterns, instanceof, and switch (Preview) [v41] In-Reply-To: <01zQgnrUk9UigmTRH4Zijckme2pKW4gUsKMzhlGorsc=.2bb5c607-644b-457d-b8d6-e1f9b6a84025@github.com> References: <4GCkSMggtYI8KnM-kELHez3Nd42WIrfd6jOF1bbK5PA=.12aec6f3-669b-4675-ad34-ffe28cb23459@github.com> <01zQgnrUk9UigmTRH4Zijckme2pKW4gUsKMzhlGorsc=.2bb5c607-644b-457d-b8d6-e1f9b6a84025@github.com> Message-ID: On Wed, 24 Jan 2024 10:26:18 GMT, Jan Lahoda wrote: >> src/java.base/share/classes/java/lang/runtime/SwitchBootstraps.java line 72: >> >>> 70: private static final Object SENTINEL = new Object(); >>> 71: private static final MethodHandles.Lookup LOOKUP = MethodHandles.lookup(); >>> 72: private static final boolean previewEnabled = true; >> >> not sure about the use of this constant, do we really need it? > > Uh, I think this is a good catch. > > I am not completely sure what the policy is, but here we are enhancing a non-preview method with some preview-based behavior. I would feel better if the method would refuse to work in the preview way when preview is not enabled. I.e. my opinion is that this should either be initialized to `jdk.internal.misc.PreviewFeatures.isEnabled()`, or `jdk.internal.misc.PreviewFeatures.ensureEnabled()` should be used appropriately. Used the `jdk.internal.misc.PreviewFeatures.isEnabled()` and remove an erroneous check in `typeSwitch`. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/15638#discussion_r1464801847 From mcimadamore at openjdk.org Wed Jan 24 12:25:34 2024 From: mcimadamore at openjdk.org (Maurizio Cimadamore) Date: Wed, 24 Jan 2024 12:25:34 GMT Subject: RFR: 8303374: Compiler Implementation for Primitive types in patterns, instanceof, and switch (Preview) [v42] In-Reply-To: References: <4GCkSMggtYI8KnM-kELHez3Nd42WIrfd6jOF1bbK5PA=.12aec6f3-669b-4675-ad34-ffe28cb23459@github.com> Message-ID: On Wed, 24 Jan 2024 11:53:52 GMT, Aggelos Biboudis wrote: >> 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 incrementally with one additional commit since the last revision: > > Set previewEnabled properly in SwitchBootstraps src/jdk.compiler/share/classes/com/sun/tools/javac/code/Types.java line 5046: > 5044: > 5045: if (target.isPrimitive()) { > 5046: return (source.isReference() && isSubtype(source, target)) || I'm a bit confused here - in here we have: * `target.isPrimitive()` * `source.isReference()` So, isn't it the case that `isSubtype(source, target)` is always false? src/jdk.compiler/share/classes/com/sun/tools/javac/comp/Attr.java line 1924: > 1922: } > 1923: // where > 1924: static final Set nonIntegralPrimitiveTypes = Set.of( This feels like a method on TypeTag? ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/15638#discussion_r1464835145 PR Review Comment: https://git.openjdk.org/jdk/pull/15638#discussion_r1464836721 From sundar at openjdk.org Wed Jan 24 12:32:30 2024 From: sundar at openjdk.org (Athijegannathan Sundararajan) Date: Wed, 24 Jan 2024 12:32:30 GMT Subject: RFR: 8323815: Source launcher should find classes with $ in names In-Reply-To: References: Message-ID: On Tue, 23 Jan 2024 07:06:41 GMT, Christian Stein wrote: > Please review this fix to make the multi-file source-code launcher find classes with `$` in names, including names of packages, names of compliation units, and also names of enclosed types. > > Tested tier1-3 Marked as reviewed by sundar (Reviewer). LGTM I tested the fix with jextract samples (jextract generates $ in names). All source mode + mixed .class + .java mode both work fine as expected. ------------- PR Review: https://git.openjdk.org/jdk/pull/17526#pullrequestreview-1841262743 PR Comment: https://git.openjdk.org/jdk/pull/17526#issuecomment-1908031020 From mcimadamore at openjdk.org Wed Jan 24 12:34:35 2024 From: mcimadamore at openjdk.org (Maurizio Cimadamore) Date: Wed, 24 Jan 2024 12:34:35 GMT Subject: RFR: 8303374: Compiler Implementation for Primitive types in patterns, instanceof, and switch (Preview) [v42] In-Reply-To: References: <4GCkSMggtYI8KnM-kELHez3Nd42WIrfd6jOF1bbK5PA=.12aec6f3-669b-4675-ad34-ffe28cb23459@github.com> Message-ID: On Wed, 24 Jan 2024 11:53:52 GMT, Aggelos Biboudis wrote: >> 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 incrementally with one additional commit since the last revision: > > Set previewEnabled properly in SwitchBootstraps src/jdk.compiler/share/classes/com/sun/tools/javac/comp/Attr.java line 4147: > 4145: } > 4146: if (clazztype.isPrimitive()) { > 4147: preview.checkSourceLevel(tree.pattern.pos(), Feature.PRIMITIVE_PATTERNS); So, if I have a primitive instanceof, I get two preview warnings, one for the expression, and one for the pattern type? Shouldn't one be enough? ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/15638#discussion_r1464846948 From mcimadamore at openjdk.org Wed Jan 24 12:17:38 2024 From: mcimadamore at openjdk.org (Maurizio Cimadamore) Date: Wed, 24 Jan 2024 12:17:38 GMT Subject: RFR: 8303374: Compiler Implementation for Primitive types in patterns, instanceof, and switch (Preview) [v42] In-Reply-To: References: <4GCkSMggtYI8KnM-kELHez3Nd42WIrfd6jOF1bbK5PA=.12aec6f3-669b-4675-ad34-ffe28cb23459@github.com> Message-ID: <_hlWjNWAiPgvNTpwVWsBKURLCwySlIt5GoWiWKTJLRs=.3f069a48-2a82-408a-ba40-84d2b75b8ed3@github.com> On Wed, 24 Jan 2024 11:53:52 GMT, Aggelos Biboudis wrote: >> 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 incrementally with one additional commit since the last revision: > > Set previewEnabled properly in SwitchBootstraps src/java.base/share/classes/java/lang/runtime/ExactConversionsSupport.java line 34: > 32: * may be used, for example, by Java compiler implementations to implement > 33: * checks for {@code instanceof} and pattern matching runtime implementations. > 34: * Unconditionally exact testing conversions do not require a corresponding "... do not require a corresponding action at runtime" ... and, for this reason, method corresponding to these conversions are omitted here src/java.base/share/classes/java/lang/runtime/ExactConversionsSupport.java line 37: > 35: * action at run time. > 36: *

    > 37: * The run time conversion checks examine whether loss of information would You provide examples for runtime conversions - it would be useful, before this para, to also have examples of an inexact conversion, an exact conversion and an unconditionally exact conversion (before diving into the details of how the runtime check is performed for floating points). ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/15638#discussion_r1464828250 PR Review Comment: https://git.openjdk.org/jdk/pull/15638#discussion_r1464826696 From mcimadamore at openjdk.org Wed Jan 24 12:43:36 2024 From: mcimadamore at openjdk.org (Maurizio Cimadamore) Date: Wed, 24 Jan 2024 12:43:36 GMT Subject: RFR: 8303374: Compiler Implementation for Primitive types in patterns, instanceof, and switch (Preview) [v42] In-Reply-To: References: <4GCkSMggtYI8KnM-kELHez3Nd42WIrfd6jOF1bbK5PA=.12aec6f3-669b-4675-ad34-ffe28cb23459@github.com> Message-ID: <7L1Al1Y3JbKk3Xw624IOvM1ESmoRmmzkHRPbs-Wy4J0=.f9d0acee-0f06-41ea-889e-a035208d38aa@github.com> On Wed, 24 Jan 2024 11:53:52 GMT, Aggelos Biboudis wrote: >> 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 incrementally with one additional commit since the last revision: > > Set previewEnabled properly in SwitchBootstraps src/jdk.compiler/share/classes/com/sun/tools/javac/comp/Lower.java line 2962: > 2960: * More rewritings: > 2961: * > 2962: * - If the `instanceof` check is unconditionally exact rewrite to true. Note: the same effect can be obtained, w/o rewriting (and perhaps more simply) by detecting the case of an unconditionally exact "instanceof" test, and giving the instanceof expression a constant boolean type (with value "true"). This can be done in Attr. Then, `Gen` will shortcircuit the expression, as required. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/15638#discussion_r1464857684 From abimpoudis at openjdk.org Wed Jan 24 14:58:55 2024 From: abimpoudis at openjdk.org (Aggelos Biboudis) Date: Wed, 24 Jan 2024 14:58:55 GMT Subject: RFR: 8303374: Implement JEP 455: Primitive Types in Patterns, instanceof, and switch (Preview) [v43] 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 incrementally with one additional commit since the last revision: Check the range of the new types of switch through TypeTag.isInSuperClassesOf ------------- Changes: - all: https://git.openjdk.org/jdk/pull/15638/files - new: https://git.openjdk.org/jdk/pull/15638/files/663c7a54..9b7fb7fc Webrevs: - full: https://webrevs.openjdk.org/?repo=jdk&pr=15638&range=42 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=15638&range=41-42 Stats: 12 lines in 2 files changed: 4 ins; 7 del; 1 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 Wed Jan 24 14:58:57 2024 From: abimpoudis at openjdk.org (Aggelos Biboudis) Date: Wed, 24 Jan 2024 14:58:57 GMT Subject: RFR: 8303374: Implement JEP 455: Primitive Types in Patterns, instanceof, and switch (Preview) [v41] In-Reply-To: References: <4GCkSMggtYI8KnM-kELHez3Nd42WIrfd6jOF1bbK5PA=.12aec6f3-669b-4675-ad34-ffe28cb23459@github.com> <01zQgnrUk9UigmTRH4Zijckme2pKW4gUsKMzhlGorsc=.2bb5c607-644b-457d-b8d6-e1f9b6a84025@github.com> Message-ID: On Wed, 24 Jan 2024 11:50:05 GMT, Aggelos Biboudis wrote: >> Uh, I think this is a good catch. >> >> I am not completely sure what the policy is, but here we are enhancing a non-preview method with some preview-based behavior. I would feel better if the method would refuse to work in the preview way when preview is not enabled. I.e. my opinion is that this should either be initialized to `jdk.internal.misc.PreviewFeatures.isEnabled()`, or `jdk.internal.misc.PreviewFeatures.ensureEnabled()` should be used appropriately. > > Used the `jdk.internal.misc.PreviewFeatures.isEnabled()` and remove an erroneous check in `typeSwitch`. Addressed in https://github.com/openjdk/jdk/pull/15638/commits/663c7a54cec9ffd6ca468080f4d084e5fa4c9c3d ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/15638#discussion_r1465039116 From abimpoudis at openjdk.org Wed Jan 24 14:59:01 2024 From: abimpoudis at openjdk.org (Aggelos Biboudis) Date: Wed, 24 Jan 2024 14:59:01 GMT Subject: RFR: 8303374: Implement JEP 455: Primitive Types in Patterns, instanceof, and switch (Preview) [v42] In-Reply-To: References: <4GCkSMggtYI8KnM-kELHez3Nd42WIrfd6jOF1bbK5PA=.12aec6f3-669b-4675-ad34-ffe28cb23459@github.com> Message-ID: <2d_xzWvSpAAcu_RvESs8LipQDSvPL5A5N12t2VL6FMo=.b16e42ce-632a-4b1f-a7ab-a417ea39f86d@github.com> On Wed, 24 Jan 2024 12:22:20 GMT, Maurizio Cimadamore wrote: >> Aggelos Biboudis has updated the pull request incrementally with one additional commit since the last revision: >> >> Set previewEnabled properly in SwitchBootstraps > > src/jdk.compiler/share/classes/com/sun/tools/javac/comp/Attr.java line 1924: > >> 1922: } >> 1923: // where >> 1924: static final Set nonIntegralPrimitiveTypes = Set.of( > > This feels like a method on TypeTag? Addressed in https://github.com/openjdk/jdk/pull/15638/commits/9b7fb7fcdd2b393425267313622970ba709c645e > src/jdk.compiler/share/classes/com/sun/tools/javac/comp/Attr.java line 4147: > >> 4145: } >> 4146: if (clazztype.isPrimitive()) { >> 4147: preview.checkSourceLevel(tree.pattern.pos(), Feature.PRIMITIVE_PATTERNS); > > So, if I have a primitive instanceof, I get two preview warnings, one for the expression, and one for the pattern type? Shouldn't one be enough? Meaning the `compiler.err.preview.feature.disabled.plural: (compiler.misc.feature.primitive.patterns)` error due to the two `if (clazztype.isPrimitive()) { preview.checkSourceLevel(tree.pattern.pos(), Feature.PRIMITIVE_PATTERNS);` ifs? Isn't it better to keep both, for better error reporting regarding the position? (i.e., which position do we report?) ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/15638#discussion_r1465034738 PR Review Comment: https://git.openjdk.org/jdk/pull/15638#discussion_r1465033188 From abimpoudis at openjdk.org Wed Jan 24 15:26:54 2024 From: abimpoudis at openjdk.org (Aggelos Biboudis) Date: Wed, 24 Jan 2024 15:26:54 GMT Subject: RFR: 8303374: Implement JEP 455: Primitive Types in Patterns, instanceof, and switch (Preview) [v44] 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 incrementally with two additional commits since the last revision: - Enhance Javadoc of ExactConversionsSupport (2) - Enhance Javadoc of ExactConversionsSupport ------------- Changes: - all: https://git.openjdk.org/jdk/pull/15638/files - new: https://git.openjdk.org/jdk/pull/15638/files/9b7fb7fc..aa9b2fcd Webrevs: - full: https://webrevs.openjdk.org/?repo=jdk&pr=15638&range=43 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=15638&range=42-43 Stats: 33 lines in 1 file changed: 15 ins; 3 del; 15 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 Wed Jan 24 15:26:57 2024 From: abimpoudis at openjdk.org (Aggelos Biboudis) Date: Wed, 24 Jan 2024 15:26:57 GMT Subject: RFR: 8303374: Implement JEP 455: Primitive Types in Patterns, instanceof, and switch (Preview) [v42] In-Reply-To: <_hlWjNWAiPgvNTpwVWsBKURLCwySlIt5GoWiWKTJLRs=.3f069a48-2a82-408a-ba40-84d2b75b8ed3@github.com> References: <4GCkSMggtYI8KnM-kELHez3Nd42WIrfd6jOF1bbK5PA=.12aec6f3-669b-4675-ad34-ffe28cb23459@github.com> <_hlWjNWAiPgvNTpwVWsBKURLCwySlIt5GoWiWKTJLRs=.3f069a48-2a82-408a-ba40-84d2b75b8ed3@github.com> Message-ID: On Wed, 24 Jan 2024 12:13:23 GMT, Maurizio Cimadamore wrote: >> Aggelos Biboudis has updated the pull request incrementally with one additional commit since the last revision: >> >> Set previewEnabled properly in SwitchBootstraps > > src/java.base/share/classes/java/lang/runtime/ExactConversionsSupport.java line 37: > >> 35: * action at run time. >> 36: *

    >> 37: * The run time conversion checks examine whether loss of information would > > You provide examples for runtime conversions - it would be useful, before this para, to also have examples of an inexact conversion, an exact conversion and an unconditionally exact conversion (before diving into the details of how the runtime check is performed for floating points). Addressed in https://github.com/openjdk/jdk/pull/15638/commits/5e48ea253bb7d8ae6fcc15a1ae7adb30475ff4ac Good point! ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/15638#discussion_r1465080703 From jiefu at openjdk.org Wed Jan 24 15:27:42 2024 From: jiefu at openjdk.org (Jie Fu) Date: Wed, 24 Jan 2024 15:27:42 GMT Subject: RFR: 8323515: Create test alias "all" for all test roots [v3] In-Reply-To: References: <9g7evWB6t3A8WAugPwgIP1gyisNBd1pGT9yFoC_0Z8M=.95b0574e-d163-4911-9c79-b58bf7301f7a@github.com> Message-ID: On Tue, 23 Jan 2024 17:03:13 GMT, Aleksey Shipilev wrote: >> Aleksey Shipilev has updated the pull request incrementally with one additional commit since the last revision: >> >> Catch-all -> All tests > > Thank you all! Hi @shipilev , plese see https://github.com/openjdk/jdk/pull/17558 . Thanks. ------------- PR Comment: https://git.openjdk.org/jdk/pull/17422#issuecomment-1908355476 From cstein at openjdk.org Wed Jan 24 15:33:53 2024 From: cstein at openjdk.org (Christian Stein) Date: Wed, 24 Jan 2024 15:33:53 GMT Subject: RFR: 8323815: Source launcher should find classes with $ in names [v2] In-Reply-To: References: Message-ID: > Please review this fix to make the multi-file source-code launcher find classes with `$` in names, including names of packages, names of compliation units, and also names of enclosed types. > > Tested tier1-3 Christian Stein has updated the pull request incrementally with one additional commit since the last revision: Include more intere'$'ting compilation units ------------- Changes: - all: https://git.openjdk.org/jdk/pull/17526/files - new: https://git.openjdk.org/jdk/pull/17526/files/a8f92b90..38482e16 Webrevs: - full: https://webrevs.openjdk.org/?repo=jdk&pr=17526&range=01 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=17526&range=00-01 Stats: 19 lines in 1 file changed: 19 ins; 0 del; 0 mod Patch: https://git.openjdk.org/jdk/pull/17526.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/17526/head:pull/17526 PR: https://git.openjdk.org/jdk/pull/17526 From cstein at openjdk.org Wed Jan 24 15:33:56 2024 From: cstein at openjdk.org (Christian Stein) Date: Wed, 24 Jan 2024 15:33:56 GMT Subject: RFR: 8323815: Source launcher should find classes with $ in names [v2] In-Reply-To: References: Message-ID: On Wed, 24 Jan 2024 08:01:09 GMT, Jan Lahoda wrote: >> Christian Stein has updated the pull request incrementally with one additional commit since the last revision: >> >> Include more intere'$'ting compilation units > > test/langtools/tools/javac/launcher/MultiFileSourceLauncherTests.java line 78: > >> 76: public static void main(String... args) throws Exception { >> 77: System.out.println(Class.forName("World$Core")); >> 78: System.out.println(Class.forName("p.q.Unit$123$Fir$t$$econd")); > > I think I would suggest two more tests: > - one that would (in a separate run) lookup `p.q.Unit$123$Fir$t` (to ensure the search is broad enough) > - one with a package name with `$`. Added both tests a suggested. The first is not test in the separate run, but a separate top-level compilation unit. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/17526#discussion_r1465095187 From cstein at openjdk.org Wed Jan 24 15:33:58 2024 From: cstein at openjdk.org (Christian Stein) Date: Wed, 24 Jan 2024 15:33:58 GMT Subject: RFR: 8323815: Source launcher should find classes with $ in names [v2] In-Reply-To: References: Message-ID: On Tue, 23 Jan 2024 15:38:31 GMT, Christian Stein wrote: >> test/langtools/tools/javac/launcher/MultiFileSourceLauncherTests.java line 89: >> >>> 87: """); >>> 88: var pq = Files.createDirectories(base.resolve("p/q")); >>> 89: Files.writeString(pq.resolve("Unit$123.java"), >> >> Maybe?keep both?tests? > > There are plenty tests for canonically named compilation units, thus that wouldn't carry much extra worth. Re-added the original test. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/17526#discussion_r1465095914 From vromero at openjdk.org Wed Jan 24 15:37:38 2024 From: vromero at openjdk.org (Vicente Romero) Date: Wed, 24 Jan 2024 15:37:38 GMT Subject: RFR: 8303374: Implement JEP 455: Primitive Types in Patterns, instanceof, and switch (Preview) [v44] In-Reply-To: References: <4GCkSMggtYI8KnM-kELHez3Nd42WIrfd6jOF1bbK5PA=.12aec6f3-669b-4675-ad34-ffe28cb23459@github.com> Message-ID: <0g1L6FBda3O8Wz02hDrLEIXzUDdRh4or6H3N-szm5Lg=.e5ec4739-577e-4833-b71d-848c26978d4d@github.com> On Wed, 24 Jan 2024 15:26:54 GMT, Aggelos Biboudis wrote: >> 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 incrementally with two additional commits since the last revision: > > - Enhance Javadoc of ExactConversionsSupport (2) > - Enhance Javadoc of ExactConversionsSupport src/java.base/share/classes/java/lang/runtime/SwitchBootstraps.java line 461: > 459: // Object o = ... > 460: // o instanceof Wrapped(float) > 461: cb.aload(0); probably just a matter of style so up to you, but I don't like the mixing of low level code generation here with higher level logic. I would prefer to see the code generation be extracted if possible to helper methods and or a separate helper class. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/15638#discussion_r1465102870 From vromero at openjdk.org Wed Jan 24 15:40:37 2024 From: vromero at openjdk.org (Vicente Romero) Date: Wed, 24 Jan 2024 15:40:37 GMT Subject: RFR: 8303374: Implement JEP 455: Primitive Types in Patterns, instanceof, and switch (Preview) [v44] In-Reply-To: References: <4GCkSMggtYI8KnM-kELHez3Nd42WIrfd6jOF1bbK5PA=.12aec6f3-669b-4675-ad34-ffe28cb23459@github.com> Message-ID: <98Xa1dqszc0IzREHFRDihwUi8_Y-NZ0i47NP-4pcfGc=.fbff61cf-f0ec-49e2-910f-19baa8c68565@github.com> On Wed, 24 Jan 2024 15:26:54 GMT, Aggelos Biboudis wrote: >> 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 incrementally with two additional commits since the last revision: > > - Enhance Javadoc of ExactConversionsSupport (2) > - Enhance Javadoc of ExactConversionsSupport src/java.base/share/classes/java/lang/runtime/SwitchBootstraps.java line 471: > 469: // o instanceof float > 470: Label notNumber = cb.newLabel(); > 471: cb.aload(0); we are wiring constants into code generation: `0`, `3` etc, probably those won't change but I would prefer using static final fields or enums, that can be documented and changed easily in the future if needed ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/15638#discussion_r1465107903 From jlahoda at openjdk.org Wed Jan 24 15:41:27 2024 From: jlahoda at openjdk.org (Jan Lahoda) Date: Wed, 24 Jan 2024 15:41:27 GMT Subject: RFR: 8323815: Source launcher should find classes with $ in names [v2] In-Reply-To: References: Message-ID: <2Mi7IF8-kdu21DA67om4fabX1NAsdwSEUyxjQeTxPDk=.3b75f3a8-97c2-4b81-92a0-dd5a9127f206@github.com> On Wed, 24 Jan 2024 15:33:53 GMT, Christian Stein wrote: >> Please review this fix to make the multi-file source-code launcher find classes with `$` in names, including names of packages, names of compliation units, and also names of enclosed types. >> >> Tested tier1-3 > > Christian Stein has updated the pull request incrementally with one additional commit since the last revision: > > Include more intere'$'ting compilation units Looks reasonable. ------------- Marked as reviewed by jlahoda (Reviewer). PR Review: https://git.openjdk.org/jdk/pull/17526#pullrequestreview-1841700931 From abimpoudis at openjdk.org Wed Jan 24 15:55:51 2024 From: abimpoudis at openjdk.org (Aggelos Biboudis) Date: Wed, 24 Jan 2024 15:55:51 GMT Subject: RFR: 8303374: Implement JEP 455: Primitive Types in Patterns, instanceof, and switch (Preview) [v45] 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 incrementally with one additional commit since the last revision: Remove redundant test from checkUnconditionallyExact ------------- Changes: - all: https://git.openjdk.org/jdk/pull/15638/files - new: https://git.openjdk.org/jdk/pull/15638/files/aa9b2fcd..0fcdca82 Webrevs: - full: https://webrevs.openjdk.org/?repo=jdk&pr=15638&range=44 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=15638&range=43-44 Stats: 2 lines in 1 file changed: 0 ins; 1 del; 1 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 Wed Jan 24 15:55:55 2024 From: abimpoudis at openjdk.org (Aggelos Biboudis) Date: Wed, 24 Jan 2024 15:55:55 GMT Subject: RFR: 8303374: Implement JEP 455: Primitive Types in Patterns, instanceof, and switch (Preview) [v42] In-Reply-To: References: <4GCkSMggtYI8KnM-kELHez3Nd42WIrfd6jOF1bbK5PA=.12aec6f3-669b-4675-ad34-ffe28cb23459@github.com> Message-ID: <9CCAFcGWzoHFi_4SaMN9i5KxnV3tSPnJAHvjQnZLE6I=.3db99d55-ded7-4a1a-a66e-fc6841af85fa@github.com> On Wed, 24 Jan 2024 12:20:55 GMT, Maurizio Cimadamore wrote: >> Aggelos Biboudis has updated the pull request incrementally with one additional commit since the last revision: >> >> Set previewEnabled properly in SwitchBootstraps > > src/jdk.compiler/share/classes/com/sun/tools/javac/code/Types.java line 5046: > >> 5044: >> 5045: if (target.isPrimitive()) { >> 5046: return (source.isReference() && isSubtype(source, target)) || > > I'm a bit confused here - in here we have: > * `target.isPrimitive()` > * `source.isReference()` > > So, isn't it the case that `isSubtype(source, target)` is always false? Yes! Thanks for spotting. https://github.com/openjdk/jdk/pull/15638/commits/0fcdca8229c0db81fe3503770ed155a6aaa4f250 ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/15638#discussion_r1465139800 From prappo at openjdk.org Wed Jan 24 16:34:38 2024 From: prappo at openjdk.org (Pavel Rappo) Date: Wed, 24 Jan 2024 16:34:38 GMT Subject: RFR: JDK-8298405: Support Markdown in Documentation Comments [v7] In-Reply-To: <0pRMUgBnvCfb7DTm_pDnIlmuYdXH8URKFAIk5cT082Y=.f4c324b6-ef98-41b3-9b06-9cb82e03b08f@github.com> References: <0pRMUgBnvCfb7DTm_pDnIlmuYdXH8URKFAIk5cT082Y=.f4c324b6-ef98-41b3-9b06-9cb82e03b08f@github.com> Message-ID: On Fri, 19 Jan 2024 18:37:48 GMT, Jonathan Gibbons wrote: >> Please review a patch to add support for Markdown syntax in documentation comments, as described in the associated JEP. >> >> Notable features: >> >> * support for `///` documentation comments in `JavaTokenizer` >> * new module `jdk.internal.md` -- a private copy of the `commonmark-java` library >> * updates to `DocCommentParser` to treat `///` comments as Markdown >> * updates to the standard doclet to render Markdown comments in HTML > > Jonathan Gibbons has updated the pull request with a new target base due to a merge or a rebase. The pull request now contains eight commits: > > - Merge with upstream/master > - Merge with upstream/master > - Merge remote-tracking branch 'upstream/master' into 8298405.doclet-markdown-v3 > - Address review comments > - Fix whitespace > - Improve handling of embedded inline taglets > - Customize support for Markdown headings > - JDK-8298405: Support Markdown in Documentation Comments src/jdk.compiler/share/classes/com/sun/tools/javac/tree/DocTreeMaker.java line 238: > 236: && postamble.isEmpty() > 237: && fullBody.stream().anyMatch(t -> t.getKind() == Kind.MARKDOWN) > 238: ? CommentStyle.JAVADOC_LINE : CommentStyle.JAVADOC_BLOCK; While clever, it seems to be prone to false positive `JAVADOC_LINE`. Also, it is inconsistent with `null` and `Position.NOPOS` returned from the `getText` and `getSourcePos(int)` methods respectively. src/jdk.compiler/share/classes/com/sun/tools/javac/tree/DocTreeMaker.java line 572: > 570: } > 571: > 572: case TEXT -> { I haven't looked at `SentenceBreaker` in detail, but one thing that bothers me is that it sees a comment before that comment has been transformed. This means that `///` comments might not "feel" like Markdown to authors. src/jdk.compiler/share/classes/com/sun/tools/javac/tree/DocTreeMaker.java line 704: > 702: } > 703: > 704: // If the break is well within the span of the string i.e. not Oh irony! Sentence segmentation in javadoc has some problems with abbreviations like that. src/jdk.compiler/share/classes/com/sun/tools/javac/tree/DocTreeMaker.java line 790: > 788: > 789: // end of paragraph is newline, followed by a blank line or the beginning of the next block > 790: private static final Pattern endPara = Pattern.compile("\n(([ \t]*\n)|( {0,3}[-+*#=]))"); So DocTreeMaker now also knows about Markdown. I wonder if we can avoid that. Also, I assume you mean this (`+` is not a part of "thematic break"): Suggestion: private static final Pattern endPara = Pattern.compile("\n(([ \t]*\n)|( {0,3}[-_*#=]))"); ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/16388#discussion_r1464830924 PR Review Comment: https://git.openjdk.org/jdk/pull/16388#discussion_r1465191542 PR Review Comment: https://git.openjdk.org/jdk/pull/16388#discussion_r1465201174 PR Review Comment: https://git.openjdk.org/jdk/pull/16388#discussion_r1465204965 From vromero at openjdk.org Wed Jan 24 17:32:38 2024 From: vromero at openjdk.org (Vicente Romero) Date: Wed, 24 Jan 2024 17:32:38 GMT Subject: RFR: 8303374: Implement JEP 455: Primitive Types in Patterns, instanceof, and switch (Preview) [v45] In-Reply-To: References: <4GCkSMggtYI8KnM-kELHez3Nd42WIrfd6jOF1bbK5PA=.12aec6f3-669b-4675-ad34-ffe28cb23459@github.com> Message-ID: On Wed, 24 Jan 2024 15:55:51 GMT, Aggelos Biboudis wrote: >> 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 incrementally with one additional commit since the last revision: > > Remove redundant test from checkUnconditionallyExact src/java.base/share/classes/java/lang/runtime/SwitchBootstraps.java line 168: > 166: requireNonNull(labels); > 167: > 168: labels = labels.clone(); just curious, why do we need to clone this array? src/java.base/share/classes/java/lang/runtime/SwitchBootstraps.java line 405: > 403: */ > 404: @SuppressWarnings("removal") > 405: private static MethodHandle generateInnerClass(MethodHandles.Lookup caller, Class selectorType, Object[] labels) { again a matter of style but it seems to me that the huge lambda inside of this method, starting in line 409, really wants to be a separate helper method. That will probably be a better refactoring as we won't be mixing byte code generation with method handles manipulation. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/15638#discussion_r1465292275 PR Review Comment: https://git.openjdk.org/jdk/pull/15638#discussion_r1465308346 From vromero at openjdk.org Wed Jan 24 17:32:41 2024 From: vromero at openjdk.org (Vicente Romero) Date: Wed, 24 Jan 2024 17:32:41 GMT Subject: RFR: 8303374: Implement JEP 455: Primitive Types in Patterns, instanceof, and switch (Preview) [v44] In-Reply-To: <0g1L6FBda3O8Wz02hDrLEIXzUDdRh4or6H3N-szm5Lg=.e5ec4739-577e-4833-b71d-848c26978d4d@github.com> References: <4GCkSMggtYI8KnM-kELHez3Nd42WIrfd6jOF1bbK5PA=.12aec6f3-669b-4675-ad34-ffe28cb23459@github.com> <0g1L6FBda3O8Wz02hDrLEIXzUDdRh4or6H3N-szm5Lg=.e5ec4739-577e-4833-b71d-848c26978d4d@github.com> Message-ID: On Wed, 24 Jan 2024 15:34:33 GMT, Vicente Romero wrote: >> Aggelos Biboudis has updated the pull request incrementally with two additional commits since the last revision: >> >> - Enhance Javadoc of ExactConversionsSupport (2) >> - Enhance Javadoc of ExactConversionsSupport > > src/java.base/share/classes/java/lang/runtime/SwitchBootstraps.java line 461: > >> 459: // Object o = ... >> 460: // o instanceof Wrapped(float) >> 461: cb.aload(0); > > probably just a matter of style so up to you, but I don't like the mixing of low level code generation here with higher level logic. I would prefer to see the code generation be extracted if possible to helper methods and or a separate helper class. see my other comment above that I think supersedes this one ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/15638#discussion_r1465309941 From darcy at openjdk.org Wed Jan 24 18:17:35 2024 From: darcy at openjdk.org (Joe Darcy) Date: Wed, 24 Jan 2024 18:17:35 GMT Subject: RFR: 8303374: Implement JEP 455: Primitive Types in Patterns, instanceof, and switch (Preview) [v45] In-Reply-To: References: <4GCkSMggtYI8KnM-kELHez3Nd42WIrfd6jOF1bbK5PA=.12aec6f3-669b-4675-ad34-ffe28cb23459@github.com> Message-ID: <_1NOO9WJQnrGflaFyaId1xfkeiijY6BAvtoIdwLhAiE=.1e6acede-f0bb-47c5-9745-f34cc82f25ed@github.com> On Wed, 24 Jan 2024 15:55:51 GMT, Aggelos Biboudis wrote: >> 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 incrementally with one additional commit since the last revision: > > Remove redundant test from checkUnconditionallyExact test/micro/org/openjdk/bench/jdk/preview/patterns/Exactness.java line 1: > 1: /* The exactness predicates should have regression tests on their correct operation in addition to any performance testing. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/15638#discussion_r1465361951 From abimpoudis at openjdk.org Wed Jan 24 18:17:35 2024 From: abimpoudis at openjdk.org (Aggelos Biboudis) Date: Wed, 24 Jan 2024 18:17:35 GMT Subject: RFR: 8303374: Implement JEP 455: Primitive Types in Patterns, instanceof, and switch (Preview) [v45] In-Reply-To: <_1NOO9WJQnrGflaFyaId1xfkeiijY6BAvtoIdwLhAiE=.1e6acede-f0bb-47c5-9745-f34cc82f25ed@github.com> References: <4GCkSMggtYI8KnM-kELHez3Nd42WIrfd6jOF1bbK5PA=.12aec6f3-669b-4675-ad34-ffe28cb23459@github.com> <_1NOO9WJQnrGflaFyaId1xfkeiijY6BAvtoIdwLhAiE=.1e6acede-f0bb-47c5-9745-f34cc82f25ed@github.com> Message-ID: On Wed, 24 Jan 2024 18:12:35 GMT, Joe Darcy wrote: >> Aggelos Biboudis has updated the pull request incrementally with one additional commit since the last revision: >> >> Remove redundant test from checkUnconditionallyExact > > test/micro/org/openjdk/bench/jdk/preview/patterns/Exactness.java line 1: > >> 1: /* > > The exactness predicates should have regression tests on their correct operation in addition to any performance testing. I have this regarding numeric values [test/langtools/tools/javac/patterns/PrimitiveInstanceOfNumericValueTests.java](https://github.com/openjdk/jdk/pull/15638/files#diff-0c7b37309d920b4c1af93789aed337c9eb259ad31977b9ef395e7b8c4b47a6d6) ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/15638#discussion_r1465363618 From darcy at openjdk.org Wed Jan 24 18:23:38 2024 From: darcy at openjdk.org (Joe Darcy) Date: Wed, 24 Jan 2024 18:23:38 GMT Subject: RFR: 8303374: Implement JEP 455: Primitive Types in Patterns, instanceof, and switch (Preview) [v45] In-Reply-To: References: <4GCkSMggtYI8KnM-kELHez3Nd42WIrfd6jOF1bbK5PA=.12aec6f3-669b-4675-ad34-ffe28cb23459@github.com> <_1NOO9WJQnrGflaFyaId1xfkeiijY6BAvtoIdwLhAiE=.1e6acede-f0bb-47c5-9745-f34cc82f25ed@github.com> Message-ID: <_UoKEsRH6GvJlMfK10Q486qghFcXnD-MgBjEIAONvZI=.d9bde165-4546-48b2-aed8-a601a11fe044@github.com> On Wed, 24 Jan 2024 18:14:11 GMT, Aggelos Biboudis wrote: > I have this regarding numeric values. Is it the kind of test you have in mind? > > [test/langtools/tools/javac/patterns/PrimitiveInstanceOfNumericValueTests.java](https://github.com/openjdk/jdk/pull/15638/files#diff-0c7b37309d920b4c1af93789aed337c9eb259ad31977b9ef395e7b8c4b47a6d6) IMO, the library methods merit some of their own dedicated direct testing (since an end user could in principle call them too) in addition to indirect tests of their operation via javac's code generation. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/15638#discussion_r1465371034 From vromero at openjdk.org Wed Jan 24 18:28:35 2024 From: vromero at openjdk.org (Vicente Romero) Date: Wed, 24 Jan 2024 18:28:35 GMT Subject: RFR: 8303374: Implement JEP 455: Primitive Types in Patterns, instanceof, and switch (Preview) [v45] In-Reply-To: References: <4GCkSMggtYI8KnM-kELHez3Nd42WIrfd6jOF1bbK5PA=.12aec6f3-669b-4675-ad34-ffe28cb23459@github.com> Message-ID: On Wed, 24 Jan 2024 15:55:51 GMT, Aggelos Biboudis wrote: >> 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 incrementally with one additional commit since the last revision: > > Remove redundant test from checkUnconditionallyExact test/langtools/tools/javac/patterns/CastConversionMatch.java line 6: > 4: * @summary Match which involves a cast conversion > 5: * @compile/fail/ref=CastConversionMatch.out -XDrawDiagnostics CastConversionMatch.java > 6: * @compile --enable-preview --source ${jdk.version} CastConversionMatch.java */ @enablePreview? ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/15638#discussion_r1465374452 From abimpoudis at openjdk.org Wed Jan 24 18:28:36 2024 From: abimpoudis at openjdk.org (Aggelos Biboudis) Date: Wed, 24 Jan 2024 18:28:36 GMT Subject: RFR: 8303374: Implement JEP 455: Primitive Types in Patterns, instanceof, and switch (Preview) [v45] In-Reply-To: References: <4GCkSMggtYI8KnM-kELHez3Nd42WIrfd6jOF1bbK5PA=.12aec6f3-669b-4675-ad34-ffe28cb23459@github.com> Message-ID: On Wed, 24 Jan 2024 18:24:34 GMT, Vicente Romero wrote: >> Aggelos Biboudis has updated the pull request incrementally with one additional commit since the last revision: >> >> Remove redundant test from checkUnconditionallyExact > > test/langtools/tools/javac/patterns/CastConversionMatch.java line 6: > >> 4: * @summary Match which involves a cast conversion >> 5: * @compile/fail/ref=CastConversionMatch.out -XDrawDiagnostics CastConversionMatch.java >> 6: * @compile --enable-preview --source ${jdk.version} CastConversionMatch.java */ > > @enablePreview? I have two compile commands. Wanted to test one with and one without preview. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/15638#discussion_r1465376180 From vromero at openjdk.org Wed Jan 24 18:31:43 2024 From: vromero at openjdk.org (Vicente Romero) Date: Wed, 24 Jan 2024 18:31:43 GMT Subject: RFR: 8303374: Implement JEP 455: Primitive Types in Patterns, instanceof, and switch (Preview) [v45] In-Reply-To: References: <4GCkSMggtYI8KnM-kELHez3Nd42WIrfd6jOF1bbK5PA=.12aec6f3-669b-4675-ad34-ffe28cb23459@github.com> Message-ID: On Wed, 24 Jan 2024 15:55:51 GMT, Aggelos Biboudis wrote: >> 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 incrementally with one additional commit since the last revision: > > Remove redundant test from checkUnconditionallyExact test/langtools/tools/javac/patterns/PrimitiveInstanceOfPatternOpWithRecordPatterns.java line 28: > 26: * @bug 8304487 > 27: * @summary Compiler Implementation for Primitive types in patterns, instanceof, and switch (Preview) > 28: * @compile -g --enable-preview -source ${jdk.version} PrimitiveInstanceOfPatternOpWithRecordPatterns.java not sure why you need `-g` here test/langtools/tools/javac/patterns/PrimitiveInstanceOfTypeComparisonOp.java line 28: > 26: * @bug 8304487 > 27: * @summary Compiler Implementation for Primitive types in patterns, instanceof, and switch (Preview) > 28: * @compile -g --enable-preview -source ${jdk.version} PrimitiveInstanceOfTypeComparisonOp.java `-g`? ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/15638#discussion_r1465376609 PR Review Comment: https://git.openjdk.org/jdk/pull/15638#discussion_r1465378575 From abimpoudis at openjdk.org Wed Jan 24 18:41:54 2024 From: abimpoudis at openjdk.org (Aggelos Biboudis) Date: Wed, 24 Jan 2024 18:41:54 GMT Subject: RFR: 8303374: Implement JEP 455: Primitive Types in Patterns, instanceof, and switch (Preview) [v46] 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 incrementally with one additional commit since the last revision: Cleanup test parameters ------------- Changes: - all: https://git.openjdk.org/jdk/pull/15638/files - new: https://git.openjdk.org/jdk/pull/15638/files/0fcdca82..ea31a804 Webrevs: - full: https://webrevs.openjdk.org/?repo=jdk&pr=15638&range=45 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=15638&range=44-45 Stats: 53 lines in 7 files changed: 5 ins; 0 del; 48 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 cstein at openjdk.org Wed Jan 24 19:08:33 2024 From: cstein at openjdk.org (Christian Stein) Date: Wed, 24 Jan 2024 19:08:33 GMT Subject: Integrated: 8323815: Source launcher should find classes with $ in names In-Reply-To: References: Message-ID: On Tue, 23 Jan 2024 07:06:41 GMT, Christian Stein wrote: > Please review this fix to make the multi-file source-code launcher find classes with `$` in names, including names of packages, names of compliation units, and also names of enclosed types. > > Tested tier1-3 This pull request has now been integrated. Changeset: c702dcab Author: Christian Stein URL: https://git.openjdk.org/jdk/commit/c702dcabf8befc2db2baf53655f20391ee5d2d09 Stats: 38 lines in 2 files changed: 30 ins; 0 del; 8 mod 8323815: Source launcher should find classes with $ in names Reviewed-by: jlahoda, sundar ------------- PR: https://git.openjdk.org/jdk/pull/17526 From abimpoudis at openjdk.org Wed Jan 24 19:33:52 2024 From: abimpoudis at openjdk.org (Aggelos Biboudis) Date: Wed, 24 Jan 2024 19:33:52 GMT Subject: RFR: 8303374: Implement JEP 455: Primitive Types in Patterns, instanceof, and switch (Preview) [v47] 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 incrementally with one additional commit since the last revision: Introduce ExactnessConversionsSupportTest ------------- Changes: - all: https://git.openjdk.org/jdk/pull/15638/files - new: https://git.openjdk.org/jdk/pull/15638/files/ea31a804..4e5ac772 Webrevs: - full: https://webrevs.openjdk.org/?repo=jdk&pr=15638&range=46 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=15638&range=45-46 Stats: 243 lines in 2 files changed: 236 ins; 0 del; 7 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 Wed Jan 24 19:36:33 2024 From: abimpoudis at openjdk.org (Aggelos Biboudis) Date: Wed, 24 Jan 2024 19:36:33 GMT Subject: RFR: 8303374: Implement JEP 455: Primitive Types in Patterns, instanceof, and switch (Preview) [v45] In-Reply-To: <_UoKEsRH6GvJlMfK10Q486qghFcXnD-MgBjEIAONvZI=.d9bde165-4546-48b2-aed8-a601a11fe044@github.com> References: <4GCkSMggtYI8KnM-kELHez3Nd42WIrfd6jOF1bbK5PA=.12aec6f3-669b-4675-ad34-ffe28cb23459@github.com> <_1NOO9WJQnrGflaFyaId1xfkeiijY6BAvtoIdwLhAiE=.1e6acede-f0bb-47c5-9745-f34cc82f25ed@github.com> <_UoKEsRH6GvJlMfK10Q486qghFcXnD-MgBjEIAONvZI=.d9bde165-4546-48b2-aed8-a601a11fe044@github.com> Message-ID: On Wed, 24 Jan 2024 18:21:11 GMT, Joe Darcy wrote: >> I have this regarding numeric values. Is it the kind of test you have in mind? >> >> [test/langtools/tools/javac/patterns/PrimitiveInstanceOfNumericValueTests.java](https://github.com/openjdk/jdk/pull/15638/files#diff-0c7b37309d920b4c1af93789aed337c9eb259ad31977b9ef395e7b8c4b47a6d6) > >> I have this regarding numeric values. Is it the kind of test you have in mind? >> >> [test/langtools/tools/javac/patterns/PrimitiveInstanceOfNumericValueTests.java](https://github.com/openjdk/jdk/pull/15638/files#diff-0c7b37309d920b4c1af93789aed337c9eb259ad31977b9ef395e7b8c4b47a6d6) > > IMO, the library methods merit some of their own dedicated direct testing (since an end user could in principle call them too) in addition to indirect tests of their operation via javac's code generation. I did a translation of that file into [ExactnessConversionsSupportTest.java](https://github.com/openjdk/jdk/pull/15638/commits/4e5ac772417a2e50d47fd6fa8feb363a6bffa88c#diff-c24740028b9956d2dd2947907713f5e2d8681e8762f6d8e26e4faf2ded3979a8). What else could I add? ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/15638#discussion_r1465445954 From vromero at openjdk.org Wed Jan 24 20:31:34 2024 From: vromero at openjdk.org (Vicente Romero) Date: Wed, 24 Jan 2024 20:31:34 GMT Subject: RFR: 8303374: Implement JEP 455: Primitive Types in Patterns, instanceof, and switch (Preview) [v45] In-Reply-To: References: <4GCkSMggtYI8KnM-kELHez3Nd42WIrfd6jOF1bbK5PA=.12aec6f3-669b-4675-ad34-ffe28cb23459@github.com> Message-ID: On Wed, 24 Jan 2024 18:26:08 GMT, Aggelos Biboudis wrote: >> test/langtools/tools/javac/patterns/CastConversionMatch.java line 6: >> >>> 4: * @summary Match which involves a cast conversion >>> 5: * @compile/fail/ref=CastConversionMatch.out -XDrawDiagnostics CastConversionMatch.java >>> 6: * @compile --enable-preview --source ${jdk.version} CastConversionMatch.java */ >> >> @enablePreview? > > I have two compile commands. Wanted to test one with and one without preview. right missed that sorry ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/15638#discussion_r1465499180 From mcimadamore at openjdk.org Wed Jan 24 21:37:34 2024 From: mcimadamore at openjdk.org (Maurizio Cimadamore) Date: Wed, 24 Jan 2024 21:37:34 GMT Subject: RFR: 8303374: Implement JEP 455: Primitive Types in Patterns, instanceof, and switch (Preview) [v42] In-Reply-To: <2d_xzWvSpAAcu_RvESs8LipQDSvPL5A5N12t2VL6FMo=.b16e42ce-632a-4b1f-a7ab-a417ea39f86d@github.com> References: <4GCkSMggtYI8KnM-kELHez3Nd42WIrfd6jOF1bbK5PA=.12aec6f3-669b-4675-ad34-ffe28cb23459@github.com> <2d_xzWvSpAAcu_RvESs8LipQDSvPL5A5N12t2VL6FMo=.b16e42ce-632a-4b1f-a7ab-a417ea39f86d@github.com> Message-ID: On Wed, 24 Jan 2024 14:53:19 GMT, Aggelos Biboudis wrote: >> src/jdk.compiler/share/classes/com/sun/tools/javac/comp/Attr.java line 4147: >> >>> 4145: } >>> 4146: if (clazztype.isPrimitive()) { >>> 4147: preview.checkSourceLevel(tree.pattern.pos(), Feature.PRIMITIVE_PATTERNS); >> >> So, if I have a primitive instanceof, I get two preview warnings, one for the expression, and one for the pattern type? Shouldn't one be enough? > > Meaning the `compiler.err.preview.feature.disabled.plural: (compiler.misc.feature.primitive.patterns)` error due to the two `if (clazztype.isPrimitive()) { preview.checkSourceLevel(tree.pattern.pos(), Feature.PRIMITIVE_PATTERNS);` ifs? Isn't it better to keep both, for better error reporting regarding the position? (i.e., which position do we report?) What I mean is that, looking at the code, it seems like: int x; if (x instanceof int y) ... will generate two warnings. Perhaps that's what we want, but it seems a bit on the heavy-side, subjectively. Anyway, no need to take any action. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/15638#discussion_r1465569066 From mcimadamore at openjdk.org Wed Jan 24 21:50:34 2024 From: mcimadamore at openjdk.org (Maurizio Cimadamore) Date: Wed, 24 Jan 2024 21:50:34 GMT Subject: RFR: 8303374: Implement JEP 455: Primitive Types in Patterns, instanceof, and switch (Preview) [v47] In-Reply-To: References: <4GCkSMggtYI8KnM-kELHez3Nd42WIrfd6jOF1bbK5PA=.12aec6f3-669b-4675-ad34-ffe28cb23459@github.com> Message-ID: On Wed, 24 Jan 2024 19:33:52 GMT, Aggelos Biboudis wrote: >> 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 incrementally with one additional commit since the last revision: > > Introduce ExactnessConversionsSupportTest src/java.base/share/classes/java/lang/runtime/ExactConversionsSupport.java line 33: > 31: * said to be unconditionally exact. > 32: *

    > 33: * For example, a conversion from {@code int} to {@code byte} for the value 10 Very nice text! src/jdk.compiler/share/classes/com/sun/tools/javac/code/Types.java line 5045: > 5043: } > 5044: > 5045: if (target.isPrimitive()) { nit: maybe now a ternary expression can be used ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/15638#discussion_r1465579085 PR Review Comment: https://git.openjdk.org/jdk/pull/15638#discussion_r1465580461 From abimpoudis at openjdk.org Wed Jan 24 23:25:03 2024 From: abimpoudis at openjdk.org (Aggelos Biboudis) Date: Wed, 24 Jan 2024 23:25:03 GMT Subject: RFR: 8303374: Implement JEP 455: Primitive Types in Patterns, instanceof, and switch (Preview) [v47] In-Reply-To: References: <4GCkSMggtYI8KnM-kELHez3Nd42WIrfd6jOF1bbK5PA=.12aec6f3-669b-4675-ad34-ffe28cb23459@github.com> Message-ID: On Wed, 24 Jan 2024 21:47:19 GMT, Maurizio Cimadamore wrote: >> Aggelos Biboudis has updated the pull request incrementally with one additional commit since the last revision: >> >> Introduce ExactnessConversionsSupportTest > > src/jdk.compiler/share/classes/com/sun/tools/javac/code/Types.java line 5045: > >> 5043: } >> 5044: >> 5045: if (target.isPrimitive()) { > > nit: maybe now a ternary expression can be used Done! ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/15638#discussion_r1465656376 From abimpoudis at openjdk.org Wed Jan 24 23:25:00 2024 From: abimpoudis at openjdk.org (Aggelos Biboudis) Date: Wed, 24 Jan 2024 23:25:00 GMT Subject: RFR: 8303374: Implement JEP 455: Primitive Types in Patterns, instanceof, and switch (Preview) [v48] 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 incrementally with one additional commit since the last revision: Simplify checkUnconditionallyExact ------------- Changes: - all: https://git.openjdk.org/jdk/pull/15638/files - new: https://git.openjdk.org/jdk/pull/15638/files/4e5ac772..4ed60e9d Webrevs: - full: https://webrevs.openjdk.org/?repo=jdk&pr=15638&range=47 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=15638&range=46-47 Stats: 5 lines in 1 file changed: 0 ins; 2 del; 3 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 Wed Jan 24 23:42:48 2024 From: abimpoudis at openjdk.org (Aggelos Biboudis) Date: Wed, 24 Jan 2024 23:42:48 GMT Subject: RFR: 8303374: Implement JEP 455: Primitive Types in Patterns, instanceof, and switch (Preview) [v49] 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 incrementally with one additional commit since the last revision: Cleanup redundant clone ------------- Changes: - all: https://git.openjdk.org/jdk/pull/15638/files - new: https://git.openjdk.org/jdk/pull/15638/files/4ed60e9d..80cfc06c Webrevs: - full: https://webrevs.openjdk.org/?repo=jdk&pr=15638&range=48 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=15638&range=47-48 Stats: 1 line in 1 file changed: 0 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 abimpoudis at openjdk.org Wed Jan 24 23:42:51 2024 From: abimpoudis at openjdk.org (Aggelos Biboudis) Date: Wed, 24 Jan 2024 23:42:51 GMT Subject: RFR: 8303374: Implement JEP 455: Primitive Types in Patterns, instanceof, and switch (Preview) [v45] In-Reply-To: References: <4GCkSMggtYI8KnM-kELHez3Nd42WIrfd6jOF1bbK5PA=.12aec6f3-669b-4675-ad34-ffe28cb23459@github.com> Message-ID: On Wed, 24 Jan 2024 17:15:06 GMT, Vicente Romero wrote: >> Aggelos Biboudis has updated the pull request incrementally with one additional commit since the last revision: >> >> Remove redundant test from checkUnconditionallyExact > > src/java.base/share/classes/java/lang/runtime/SwitchBootstraps.java line 168: > >> 166: requireNonNull(labels); >> 167: >> 168: labels = labels.clone(); > > just curious, why do we need to clone this array? No need. Remainings of a previous approach. Thanks for spotting ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/15638#discussion_r1465672119 From abimpoudis at openjdk.org Wed Jan 24 23:50:51 2024 From: abimpoudis at openjdk.org (Aggelos Biboudis) Date: Wed, 24 Jan 2024 23:50:51 GMT Subject: RFR: 8303374: Implement JEP 455: Primitive Types in Patterns, instanceof, and switch (Preview) [v50] 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 incrementally with one additional commit since the last revision: Update year ------------- Changes: - all: https://git.openjdk.org/jdk/pull/15638/files - new: https://git.openjdk.org/jdk/pull/15638/files/80cfc06c..2af70ba2 Webrevs: - full: https://webrevs.openjdk.org/?repo=jdk&pr=15638&range=49 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=15638&range=48-49 Stats: 3 lines in 3 files changed: 0 ins; 0 del; 3 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 darcy at openjdk.org Thu Jan 25 02:57:40 2024 From: darcy at openjdk.org (Joe Darcy) Date: Thu, 25 Jan 2024 02:57:40 GMT Subject: RFR: JDK-8302019: Clarify Elements.overrides Message-ID: Explicitly discuss and test handling of an interface declaring methods that "override" public methods on java.lang.Object. ------------- Commit messages: - Appease jcheck. - JDK-8302019: Clarify Elements.overrides Changes: https://git.openjdk.org/jdk/pull/17564/files Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=17564&range=00 Issue: https://bugs.openjdk.org/browse/JDK-8302019 Stats: 129 lines in 2 files changed: 129 ins; 0 del; 0 mod Patch: https://git.openjdk.org/jdk/pull/17564.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/17564/head:pull/17564 PR: https://git.openjdk.org/jdk/pull/17564 From darcy at openjdk.org Thu Jan 25 05:17:41 2024 From: darcy at openjdk.org (Joe Darcy) Date: Thu, 25 Jan 2024 05:17:41 GMT Subject: RFR: JDK-8302019: Clarify Elements.overrides [v2] In-Reply-To: References: Message-ID: > Explicitly discuss and test handling of an interface declaring methods that "override" public methods on java.lang.Object. Joe Darcy has updated the pull request incrementally with one additional commit since the last revision: Update wording. ------------- Changes: - all: https://git.openjdk.org/jdk/pull/17564/files - new: https://git.openjdk.org/jdk/pull/17564/files/85983e2f..45bc365b Webrevs: - full: https://webrevs.openjdk.org/?repo=jdk&pr=17564&range=01 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=17564&range=00-01 Stats: 4 lines in 1 file changed: 0 ins; 0 del; 4 mod Patch: https://git.openjdk.org/jdk/pull/17564.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/17564/head:pull/17564 PR: https://git.openjdk.org/jdk/pull/17564 From prappo at openjdk.org Thu Jan 25 09:25:31 2024 From: prappo at openjdk.org (Pavel Rappo) Date: Thu, 25 Jan 2024 09:25:31 GMT Subject: RFR: JDK-8302019: Clarify Elements.overrides [v2] In-Reply-To: References: Message-ID: <9YgRi9ryBWc6mjNw3UkzWHBAXvt6-0x0X5u7InSX9uA=.1bfd195c-232b-4014-bacf-4fdbbf3b0e0d@github.com> On Thu, 25 Jan 2024 05:17:41 GMT, Joe Darcy wrote: >> Explicitly discuss and test handling of an interface declaring methods that "override" public methods on java.lang.Object. > > Joe Darcy has updated the pull request incrementally with one additional commit since the last revision: > > Update wording. Thanks for addressing this, Joe. I have a few minor comments. src/java.compiler/share/classes/javax/lang/model/util/Elements.java line 692: > 690: * Consistent with the usage of the {@code @Override} annotation, if an > 691: * interface declares a method override-equivalent to a {@code > 692: * public} method on {@code java.lang.Object}, this method treats Nit: I'm not sure about "on". JLS uses "of" in a similar [context]: > the method is override-equivalent to a public method of Object It seems like the only similar use of "on" in javax.** can be found here: https://github.com/openjdk/jdk/blob/1f89acd8498945e1d531b7845748bcee8194115b/src/java.compiler/share/classes/javax/tools/StandardJavaFileManager.java#L149-L151 In other cases, "on" is preceded by "invoke" or "call", which has a different meaning. [context]: https://docs.oracle.com/javase/specs/jls/se21/html/jls-9.html#jls-9.6.4.4 test/langtools/tools/javac/processing/model/util/elements/TestOverrides.java line 63: > 61: if (expectedOverrideResult != > 62: elements.overrides(method, findMethod(methodName, objectElt), objectInterfaceElt ) ) { > 63: throw new RuntimeException("Unexpected overrding relation found for " + method); Suggestion: throw new RuntimeException("Unexpected overriding relation found for " + method); test/langtools/tools/javac/processing/model/util/elements/TestOverrides.java line 88: > 86: > 87: /** > 88: * Interface that has methods override-equivalent to methods on Similar comment on "on". test/langtools/tools/javac/processing/model/util/elements/TestOverrides.java line 110: > 108: void finalize(); > 109: > 110: // Final methods on Object (getClass, wait, notify[all]) rejected Ditto. ------------- PR Review: https://git.openjdk.org/jdk/pull/17564#pullrequestreview-1843157189 PR Review Comment: https://git.openjdk.org/jdk/pull/17564#discussion_r1466040622 PR Review Comment: https://git.openjdk.org/jdk/pull/17564#discussion_r1466066047 PR Review Comment: https://git.openjdk.org/jdk/pull/17564#discussion_r1466045235 PR Review Comment: https://git.openjdk.org/jdk/pull/17564#discussion_r1466069947 From mcimadamore at openjdk.org Thu Jan 25 10:00:47 2024 From: mcimadamore at openjdk.org (Maurizio Cimadamore) Date: Thu, 25 Jan 2024 10:00:47 GMT Subject: RFR: 8303374: Implement JEP 455: Primitive Types in Patterns, instanceof, and switch (Preview) [v50] In-Reply-To: References: <4GCkSMggtYI8KnM-kELHez3Nd42WIrfd6jOF1bbK5PA=.12aec6f3-669b-4675-ad34-ffe28cb23459@github.com> Message-ID: On Wed, 24 Jan 2024 23:50:51 GMT, Aggelos Biboudis wrote: >> 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 incrementally with one additional commit since the last revision: > > Update year src/java.base/share/classes/java/lang/runtime/SwitchBootstraps.java line 148: > 146: * @throws NullPointerException if any argument is {@code null} > 147: * @throws IllegalArgumentException if any element in the labels array is null, if the > 148: * invocation type is not a method type of first parameter of a reference type, One thing we did often in the FFM API was to break up long `@throws` and split them into two or three `@throws` (javadoc allows the same exception to appear multiple times). Not saying you have to change this, just a possible suggestion (as I didn't know this!) ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/15638#discussion_r1466119276 From mcimadamore at openjdk.org Thu Jan 25 10:15:45 2024 From: mcimadamore at openjdk.org (Maurizio Cimadamore) Date: Thu, 25 Jan 2024 10:15:45 GMT Subject: RFR: 8303374: Implement JEP 455: Primitive Types in Patterns, instanceof, and switch (Preview) [v44] In-Reply-To: <98Xa1dqszc0IzREHFRDihwUi8_Y-NZ0i47NP-4pcfGc=.fbff61cf-f0ec-49e2-910f-19baa8c68565@github.com> References: <4GCkSMggtYI8KnM-kELHez3Nd42WIrfd6jOF1bbK5PA=.12aec6f3-669b-4675-ad34-ffe28cb23459@github.com> <98Xa1dqszc0IzREHFRDihwUi8_Y-NZ0i47NP-4pcfGc=.fbff61cf-f0ec-49e2-910f-19baa8c68565@github.com> Message-ID: On Wed, 24 Jan 2024 15:37:58 GMT, Vicente Romero wrote: >> Aggelos Biboudis has updated the pull request incrementally with two additional commits since the last revision: >> >> - Enhance Javadoc of ExactConversionsSupport (2) >> - Enhance Javadoc of ExactConversionsSupport > > src/java.base/share/classes/java/lang/runtime/SwitchBootstraps.java line 471: > >> 469: // o instanceof float >> 470: Label notNumber = cb.newLabel(); >> 471: cb.aload(0); > > we are wiring constants into code generation: `0`, `3` etc, probably those won't change but I would prefer using static final fields or enums, that can be documented and changed easily in the future if needed Note also that the classfile API supports an higher-level construct to access method parameters, which supports _logical_ indexes (see CodeBuilder::parameterSlot). This would make the indices more robust against changes in types (e.g. int vs. long, where the latter would require two local variable slots) ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/15638#discussion_r1466139675 From mcimadamore at openjdk.org Thu Jan 25 10:18:39 2024 From: mcimadamore at openjdk.org (Maurizio Cimadamore) Date: Thu, 25 Jan 2024 10:18:39 GMT Subject: RFR: 8303374: Implement JEP 455: Primitive Types in Patterns, instanceof, and switch (Preview) [v50] In-Reply-To: References: <4GCkSMggtYI8KnM-kELHez3Nd42WIrfd6jOF1bbK5PA=.12aec6f3-669b-4675-ad34-ffe28cb23459@github.com> Message-ID: <6ca0VuWfm7LeOOW5RZ818DP2zSafC87fdBt3LS2ZxPo=.7d7d6285-63a0-4982-95c3-891a9ff86dd2@github.com> On Wed, 24 Jan 2024 23:50:51 GMT, Aggelos Biboudis wrote: >> 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 incrementally with one additional commit since the last revision: > > Update year src/java.base/share/classes/java/lang/runtime/SwitchBootstraps.java line 592: > 590: element.caseLabel() instanceof Double || > 591: element.caseLabel() instanceof Boolean)) { > 592: //TODO: should call equals on the constant, not on the selector, check Looking at the code, it seems like we're already calling equals on the constant? (I assume that's to avoid spurious NPEs?) ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/15638#discussion_r1466143827 From mcimadamore at openjdk.org Thu Jan 25 10:25:38 2024 From: mcimadamore at openjdk.org (Maurizio Cimadamore) Date: Thu, 25 Jan 2024 10:25:38 GMT Subject: RFR: 8303374: Implement JEP 455: Primitive Types in Patterns, instanceof, and switch (Preview) [v50] In-Reply-To: References: <4GCkSMggtYI8KnM-kELHez3Nd42WIrfd6jOF1bbK5PA=.12aec6f3-669b-4675-ad34-ffe28cb23459@github.com> Message-ID: On Wed, 24 Jan 2024 23:50:51 GMT, Aggelos Biboudis wrote: >> 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 incrementally with one additional commit since the last revision: > > Update year src/java.base/share/classes/java/lang/runtime/SwitchBootstraps.java line 404: > 402: */ > 403: @SuppressWarnings("removal") > 404: private static MethodHandle generateInnerClass(MethodHandles.Lookup caller, Class selectorType, Object[] labels) { I think the name "labels" for the array here is unfortunate, because the code generation also contains "labels" which mean really "jump targets". Maybe `constants` or `labelConstants` or `caseConstants` ? src/java.base/share/classes/java/lang/runtime/SwitchBootstraps.java line 517: > 515: } > 516: } else { > 517: Optional classLabelConstableOpt = classLabel.describeConstable(); One comment (for future work): we have a bunch of constants that are known by the time we generate this code (at runtime). But we're still serializing them into the constant pool, and then deserialize them at runtime, which is needless work. Hidden classes support injection of already resolved constants into the constant pool - see: https://download.java.net/java/early_access/jdk22/docs/api/java.base/java/lang/invoke/MethodHandles.Lookup.html#defineHiddenClassWithClassData(byte%5B%5D,java.lang.Object,boolean,java.lang.invoke.MethodHandles.Lookup.ClassOption...) Basically, the idea is that you can pass the entire `labels` array as a "constant data" which is stored in the constant pool as a pre-resolved constant. You can then load elements from this array using ready-made method handles: https://download.java.net/java/early_access/jdk22/docs/api/java.base/java/lang/invoke/MethodHandles.html#classDataAt(java.lang.invoke.MethodHandles.Lookup,java.lang.String,java.lang.Class,int) ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/15638#discussion_r1466151276 PR Review Comment: https://git.openjdk.org/jdk/pull/15638#discussion_r1466149901 From mcimadamore at openjdk.org Thu Jan 25 10:25:40 2024 From: mcimadamore at openjdk.org (Maurizio Cimadamore) Date: Thu, 25 Jan 2024 10:25:40 GMT Subject: RFR: 8303374: Implement JEP 455: Primitive Types in Patterns, instanceof, and switch (Preview) [v44] In-Reply-To: References: <4GCkSMggtYI8KnM-kELHez3Nd42WIrfd6jOF1bbK5PA=.12aec6f3-669b-4675-ad34-ffe28cb23459@github.com> <0g1L6FBda3O8Wz02hDrLEIXzUDdRh4or6H3N-szm5Lg=.e5ec4739-577e-4833-b71d-848c26978d4d@github.com> Message-ID: On Wed, 24 Jan 2024 17:30:34 GMT, Vicente Romero wrote: >> src/java.base/share/classes/java/lang/runtime/SwitchBootstraps.java line 461: >> >>> 459: // Object o = ... >>> 460: // o instanceof Wrapped(float) >>> 461: cb.aload(0); >> >> probably just a matter of style so up to you, but I don't like the mixing of low level code generation here with higher level logic. I would prefer to see the code generation be extracted if possible to helper methods and or a separate helper class. > > see my other comment above that I think supersedes this one I see what you mean, that said, I think having some high-level checks driving low-level classfile generation is pretty standard for code generators (e.g. lambda metafactory, invoke bytecode generator, binding specializer). I agree on the fact that the lambda should probably moved onto a separate method. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/15638#discussion_r1466153248 From jlahoda at openjdk.org Thu Jan 25 10:54:36 2024 From: jlahoda at openjdk.org (Jan Lahoda) Date: Thu, 25 Jan 2024 10:54:36 GMT Subject: RFR: 8303374: Implement JEP 455: Primitive Types in Patterns, instanceof, and switch (Preview) [v50] In-Reply-To: <6ca0VuWfm7LeOOW5RZ818DP2zSafC87fdBt3LS2ZxPo=.7d7d6285-63a0-4982-95c3-891a9ff86dd2@github.com> References: <4GCkSMggtYI8KnM-kELHez3Nd42WIrfd6jOF1bbK5PA=.12aec6f3-669b-4675-ad34-ffe28cb23459@github.com> <6ca0VuWfm7LeOOW5RZ818DP2zSafC87fdBt3LS2ZxPo=.7d7d6285-63a0-4982-95c3-891a9ff86dd2@github.com> Message-ID: On Thu, 25 Jan 2024 10:15:48 GMT, Maurizio Cimadamore wrote: >> Aggelos Biboudis has updated the pull request incrementally with one additional commit since the last revision: >> >> Update year > > src/java.base/share/classes/java/lang/runtime/SwitchBootstraps.java line 592: > >> 590: element.caseLabel() instanceof Double || >> 591: element.caseLabel() instanceof Boolean)) { >> 592: //TODO: should call equals on the constant, not on the selector, check > > Looking at the code, it seems like we're already calling equals on the constant? (I assume that's to avoid spurious NPEs?) The note there was to double-check that for selector `s` and constant `l`, we do something like `Long.valueOf(l).equals(s)`, not `s.equals(Long.valueOf(l))`, as the latter does not have the proper semantics. I believe Angelos is adding a test checking this is (and remains) the case. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/15638#discussion_r1466189962 From jlahoda at openjdk.org Thu Jan 25 10:54:33 2024 From: jlahoda at openjdk.org (Jan Lahoda) Date: Thu, 25 Jan 2024 10:54:33 GMT Subject: RFR: 8303374: Implement JEP 455: Primitive Types in Patterns, instanceof, and switch (Preview) [v44] In-Reply-To: References: <4GCkSMggtYI8KnM-kELHez3Nd42WIrfd6jOF1bbK5PA=.12aec6f3-669b-4675-ad34-ffe28cb23459@github.com> <98Xa1dqszc0IzREHFRDihwUi8_Y-NZ0i47NP-4pcfGc=.fbff61cf-f0ec-49e2-910f-19baa8c68565@github.com> Message-ID: On Thu, 25 Jan 2024 10:12:31 GMT, Maurizio Cimadamore wrote: >> src/java.base/share/classes/java/lang/runtime/SwitchBootstraps.java line 471: >> >>> 469: // o instanceof float >>> 470: Label notNumber = cb.newLabel(); >>> 471: cb.aload(0); >> >> we are wiring constants into code generation: `0`, `3` etc, probably those won't change but I would prefer using static final fields or enums, that can be documented and changed easily in the future if needed > > Note also that the classfile API supports an higher-level construct to access method parameters, which supports _logical_ indexes (see CodeBuilder::parameterSlot). This would make the indices more robust against changes in types (e.g. int vs. long, where the latter would require two local variable slots) This code is intentionally using low-level primitives, as Classfile API is using pattern matching, and using some higher-level primitives is not possible due to the bootstrap issues. `parameterSlot` would probably work, but it does not seem too significant - we know the parameter types that are send to the method, and it is a static method. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/15638#discussion_r1466187756 From abimpoudis at openjdk.org Thu Jan 25 11:21:12 2024 From: abimpoudis at openjdk.org (Aggelos Biboudis) Date: Thu, 25 Jan 2024 11:21:12 GMT Subject: RFR: 8303374: Implement JEP 455: Primitive Types in Patterns, instanceof, and switch (Preview) [v51] 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 incrementally with one additional commit since the last revision: Improve readability in SwitchBootstraps ------------- Changes: - all: https://git.openjdk.org/jdk/pull/15638/files - new: https://git.openjdk.org/jdk/pull/15638/files/2af70ba2..13bfc436 Webrevs: - full: https://webrevs.openjdk.org/?repo=jdk&pr=15638&range=50 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=15638&range=49-50 Stats: 347 lines in 2 files changed: 138 ins; 115 del; 94 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 Thu Jan 25 11:21:12 2024 From: abimpoudis at openjdk.org (Aggelos Biboudis) Date: Thu, 25 Jan 2024 11:21:12 GMT Subject: RFR: 8303374: Implement JEP 455: Primitive Types in Patterns, instanceof, and switch (Preview) [v50] In-Reply-To: References: <4GCkSMggtYI8KnM-kELHez3Nd42WIrfd6jOF1bbK5PA=.12aec6f3-669b-4675-ad34-ffe28cb23459@github.com> Message-ID: On Thu, 25 Jan 2024 10:21:26 GMT, Maurizio Cimadamore wrote: >> Aggelos Biboudis has updated the pull request incrementally with one additional commit since the last revision: >> >> Update year > > src/java.base/share/classes/java/lang/runtime/SwitchBootstraps.java line 404: > >> 402: */ >> 403: @SuppressWarnings("removal") >> 404: private static MethodHandle generateInnerClass(MethodHandles.Lookup caller, Class selectorType, Object[] labels) { > > I think the name "labels" for the array here is unfortunate, because the code generation also contains "labels" which mean really "jump targets". Maybe `constants` or `labelConstants` or `caseConstants` ? Done ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/15638#discussion_r1466217507 From abimpoudis at openjdk.org Thu Jan 25 11:21:13 2024 From: abimpoudis at openjdk.org (Aggelos Biboudis) Date: Thu, 25 Jan 2024 11:21:13 GMT Subject: RFR: 8303374: Implement JEP 455: Primitive Types in Patterns, instanceof, and switch (Preview) [v45] In-Reply-To: References: <4GCkSMggtYI8KnM-kELHez3Nd42WIrfd6jOF1bbK5PA=.12aec6f3-669b-4675-ad34-ffe28cb23459@github.com> Message-ID: On Wed, 24 Jan 2024 17:29:09 GMT, Vicente Romero wrote: >> Aggelos Biboudis has updated the pull request incrementally with one additional commit since the last revision: >> >> Remove redundant test from checkUnconditionallyExact > > src/java.base/share/classes/java/lang/runtime/SwitchBootstraps.java line 405: > >> 403: */ >> 404: @SuppressWarnings("removal") >> 405: private static MethodHandle generateInnerClass(MethodHandles.Lookup caller, Class selectorType, Object[] labels) { > > again a matter of style but it seems to me that the huge lambda inside of this method, starting in line 409, really wants to be a separate helper method. That will probably be a better refactoring as we won't be mixing byte code generation with method handles manipulation. Done ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/15638#discussion_r1466217863 From abimpoudis at openjdk.org Thu Jan 25 11:21:13 2024 From: abimpoudis at openjdk.org (Aggelos Biboudis) Date: Thu, 25 Jan 2024 11:21:13 GMT Subject: RFR: 8303374: Implement JEP 455: Primitive Types in Patterns, instanceof, and switch (Preview) [v44] In-Reply-To: References: <4GCkSMggtYI8KnM-kELHez3Nd42WIrfd6jOF1bbK5PA=.12aec6f3-669b-4675-ad34-ffe28cb23459@github.com> <0g1L6FBda3O8Wz02hDrLEIXzUDdRh4or6H3N-szm5Lg=.e5ec4739-577e-4833-b71d-848c26978d4d@github.com> Message-ID: On Thu, 25 Jan 2024 10:22:52 GMT, Maurizio Cimadamore wrote: >> see my other comment above that I think supersedes this one > > I see what you mean, that said, I think having some high-level checks driving low-level classfile generation is pretty standard for code generators (e.g. lambda metafactory, invoke bytecode generator, binding specializer). I agree on the fact that the lambda should probably moved onto a separate method. Done in https://github.com/openjdk/jdk/pull/15638/commits/13bfc43654f23f842ac71c1971de32da209d64d3 ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/15638#discussion_r1466219133 From abimpoudis at openjdk.org Thu Jan 25 13:53:06 2024 From: abimpoudis at openjdk.org (Aggelos Biboudis) Date: Thu, 25 Jan 2024 13:53:06 GMT Subject: RFR: 8303374: Implement JEP 455: Primitive Types in Patterns, instanceof, and switch (Preview) [v50] In-Reply-To: References: <4GCkSMggtYI8KnM-kELHez3Nd42WIrfd6jOF1bbK5PA=.12aec6f3-669b-4675-ad34-ffe28cb23459@github.com> Message-ID: On Thu, 25 Jan 2024 09:57:13 GMT, Maurizio Cimadamore wrote: >> Aggelos Biboudis has updated the pull request incrementally with one additional commit since the last revision: >> >> Update year > > src/java.base/share/classes/java/lang/runtime/SwitchBootstraps.java line 148: > >> 146: * @throws NullPointerException if any argument is {@code null} >> 147: * @throws IllegalArgumentException if any element in the labels array is null, if the >> 148: * invocation type is not a method type of first parameter of a reference type, > > One thing we did often in the FFM API was to break up long `@throws` and split them into two or three `@throws` (javadoc allows the same exception to appear multiple times). Not saying you have to change this, just a possible suggestion (as I didn't know this!) Indeed it looks better: Screenshot 2024-01-25 at 14 49 07 ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/15638#discussion_r1466406565 From abimpoudis at openjdk.org Thu Jan 25 13:53:04 2024 From: abimpoudis at openjdk.org (Aggelos Biboudis) Date: Thu, 25 Jan 2024 13:53:04 GMT Subject: RFR: 8303374: Implement JEP 455: Primitive Types in Patterns, instanceof, and switch (Preview) [v52] 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 incrementally with one additional commit since the last revision: Tidy up Javadoc of IllegalArgumentException in typeSwitch ------------- Changes: - all: https://git.openjdk.org/jdk/pull/15638/files - new: https://git.openjdk.org/jdk/pull/15638/files/13bfc436..b77d2316 Webrevs: - full: https://webrevs.openjdk.org/?repo=jdk&pr=15638&range=51 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=15638&range=50-51 Stats: 9 lines in 1 file changed: 1 ins; 0 del; 8 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 prappo at openjdk.org Thu Jan 25 16:54:44 2024 From: prappo at openjdk.org (Pavel Rappo) Date: Thu, 25 Jan 2024 16:54:44 GMT Subject: RFR: JDK-8298405: Support Markdown in Documentation Comments [v7] In-Reply-To: <_WLv7XFq2-900uOZFhRJ8rLQmjlFdTlHmC9wVfS6I-Y=.1ada9999-1a0e-4f88-aa67-5d4120585f35@github.com> References: <0pRMUgBnvCfb7DTm_pDnIlmuYdXH8URKFAIk5cT082Y=.f4c324b6-ef98-41b3-9b06-9cb82e03b08f@github.com> <_WLv7XFq2-900uOZFhRJ8rLQmjlFdTlHmC9wVfS6I-Y=.1ada9999-1a0e-4f88-aa67-5d4120585f35@github.com> Message-ID: <0zUYUefrZalsT0jrEQtrvFotZ5JPLWuNxSromK26qM8=.2e1139ff-e3f1-4f74-87cf-ffdd684d6b50@github.com> On Tue, 23 Jan 2024 12:22:19 GMT, Pavel Rappo wrote: >> Jonathan Gibbons has updated the pull request with a new target base due to a merge or a rebase. The pull request now contains eight commits: >> >> - Merge with upstream/master >> - Merge with upstream/master >> - Merge remote-tracking branch 'upstream/master' into 8298405.doclet-markdown-v3 >> - Address review comments >> - Fix whitespace >> - Improve handling of embedded inline taglets >> - Customize support for Markdown headings >> - JDK-8298405: Support Markdown in Documentation Comments > > src/jdk.compiler/share/classes/com/sun/tools/javac/parser/DocCommentParser.java line 1388: > >> 1386: * @see Thematic Break >> 1387: */ >> 1388: THEMATIC_BREAK(Pattern.compile("((\\+[ \t]*+){3,})|((-[ \t]*+){3,})|((_[ \t]*+){3,})")), > > Suggestion: > > /** > * Thematic break: a line of * - _ interspersed with optional spaces and tabs > * @see Thematic Break > */ > THEMATIC_BREAK(Pattern.compile("((\*[ \t]*+){3,})|((-[ \t]*+){3,})|((_[ \t]*+){3,})")), To add to my earlier [comment], DocCommentParser recognises THEMATIC_BREAK consisting of `-` as SETEXT_UNDERLINE. While it's inaccurate, it doesn't seem important, as DCP's goal is to recognise and avoid Markdown, not process it. [comment]: https://github.com/openjdk/jdk/pull/16388/files#r1462148038 ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/16388#discussion_r1466315132 From prappo at openjdk.org Thu Jan 25 16:54:51 2024 From: prappo at openjdk.org (Pavel Rappo) Date: Thu, 25 Jan 2024 16:54:51 GMT Subject: RFR: JDK-8298405: Support Markdown in Documentation Comments [v7] In-Reply-To: <0pRMUgBnvCfb7DTm_pDnIlmuYdXH8URKFAIk5cT082Y=.f4c324b6-ef98-41b3-9b06-9cb82e03b08f@github.com> References: <0pRMUgBnvCfb7DTm_pDnIlmuYdXH8URKFAIk5cT082Y=.f4c324b6-ef98-41b3-9b06-9cb82e03b08f@github.com> Message-ID: On Fri, 19 Jan 2024 18:37:48 GMT, Jonathan Gibbons wrote: >> Please review a patch to add support for Markdown syntax in documentation comments, as described in the associated JEP. >> >> Notable features: >> >> * support for `///` documentation comments in `JavaTokenizer` >> * new module `jdk.internal.md` -- a private copy of the `commonmark-java` library >> * updates to `DocCommentParser` to treat `///` comments as Markdown >> * updates to the standard doclet to render Markdown comments in HTML > > Jonathan Gibbons has updated the pull request with a new target base due to a merge or a rebase. The pull request now contains eight commits: > > - Merge with upstream/master > - Merge with upstream/master > - Merge remote-tracking branch 'upstream/master' into 8298405.doclet-markdown-v3 > - Address review comments > - Fix whitespace > - Improve handling of embedded inline taglets > - Customize support for Markdown headings > - JDK-8298405: Support Markdown in Documentation Comments src/jdk.internal.md/share/classes/jdk/internal/markdown/MarkdownTransformer.java line 221: > 219: } > 220: String code = t.getContent(); > 221: // handle the (unlikely) case of FFFC characters existing in the code For consistency with the rest of the file: Suggestion: // handle the (unlikely) case of U+FFFC characters existing in the code src/jdk.internal.md/share/classes/jdk/internal/markdown/MarkdownTransformer.java line 230: > 228: start = pos + 1; > 229: } > 230: sourceBuilder.append(code.substring(start)); If I understood this correctly, it could be achieved simpler: Suggestion: replacements.add(PLACEHOLDER); start = pos + 1; } sourceBuilder.append(code); src/jdk.internal.md/share/classes/jdk/internal/markdown/MarkdownTransformer.java line 353: > 351: return (equal(desc2, tree.description)) > 352: ? tree > 353: : m.at(tree.pos).newReturnTree(tree.inline, desc2).setEndPos(tree.getEndPos()); Don't we need to set end position here only if the tag is in its inline variant? src/jdk.internal.md/share/classes/jdk/internal/markdown/MarkdownTransformer.java line 487: > 485: } > 486: > 487: private static final String AUTOREF_PREFIX = "code:"; I wish the prefix were such that it could not be forged: for example, automatically assigned, unique within a document comment. src/jdk.internal.md/share/classes/jdk/internal/markdown/MarkdownTransformer.java line 543: > 541: @Override > 542: public LinkReferenceDefinition getLinkReferenceDefinition(String label) { > 543: var l = label.replace("\\[\\]", "[]"); That `String.replace` looks suspicious. FWIW, when I removed that `replace`, no tests failed. src/jdk.internal.md/share/classes/jdk/internal/markdown/MarkdownTransformer.java line 559: > 557: private boolean isReference(String s) { > 558: try { > 559: var ref = refParser.parse(s, ReferenceParser.Mode.MEMBER_OPTIONAL); Suggestion: refParser.parse(s, ReferenceParser.Mode.MEMBER_OPTIONAL); src/jdk.internal.md/share/classes/jdk/internal/markdown/MarkdownTransformer.java line 771: > 769: copyTo(getStartPos(link)); > 770: // push temporary value for {@code trees} while handling the content of the node > 771: var saveTrees = trees; "saveTrees": I see what you did there :-) src/jdk.internal.md/share/classes/jdk/internal/markdown/MarkdownTransformer.java line 882: > 880: private int getStartPos(Node node) { > 881: var spans = node.getSourceSpans(); > 882: var firstSpan = spans.get(0); Suggestion: var firstSpan = spans.getFirst(); src/jdk.internal.md/share/classes/jdk/internal/markdown/MarkdownTransformer.java line 894: > 892: private int getEndPos(Node node) { > 893: var spans = node.getSourceSpans(); > 894: var lastSpan = spans.get(spans.size() - 1); Suggestion: var lastSpan = spans.getLast(); ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/16388#discussion_r1465455477 PR Review Comment: https://git.openjdk.org/jdk/pull/16388#discussion_r1465591498 PR Review Comment: https://git.openjdk.org/jdk/pull/16388#discussion_r1465400705 PR Review Comment: https://git.openjdk.org/jdk/pull/16388#discussion_r1465628293 PR Review Comment: https://git.openjdk.org/jdk/pull/16388#discussion_r1465625839 PR Review Comment: https://git.openjdk.org/jdk/pull/16388#discussion_r1465626080 PR Review Comment: https://git.openjdk.org/jdk/pull/16388#discussion_r1466197262 PR Review Comment: https://git.openjdk.org/jdk/pull/16388#discussion_r1465642275 PR Review Comment: https://git.openjdk.org/jdk/pull/16388#discussion_r1465642491 From darcy at openjdk.org Thu Jan 25 17:03:46 2024 From: darcy at openjdk.org (Joe Darcy) Date: Thu, 25 Jan 2024 17:03:46 GMT Subject: RFR: JDK-8302019: Clarify Elements.overrides [v3] In-Reply-To: References: Message-ID: > Explicitly discuss and test handling of an interface declaring methods that "override" public methods on java.lang.Object. Joe Darcy has updated the pull request incrementally with one additional commit since the last revision: Implement code review feedback. ------------- Changes: - all: https://git.openjdk.org/jdk/pull/17564/files - new: https://git.openjdk.org/jdk/pull/17564/files/45bc365b..b800846f Webrevs: - full: https://webrevs.openjdk.org/?repo=jdk&pr=17564&range=02 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=17564&range=01-02 Stats: 3 lines in 2 files changed: 0 ins; 0 del; 3 mod Patch: https://git.openjdk.org/jdk/pull/17564.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/17564/head:pull/17564 PR: https://git.openjdk.org/jdk/pull/17564 From darcy at openjdk.org Thu Jan 25 17:26:51 2024 From: darcy at openjdk.org (Joe Darcy) Date: Thu, 25 Jan 2024 17:26:51 GMT Subject: RFR: JDK-8302019: Clarify Elements.overrides [v4] In-Reply-To: References: Message-ID: > Explicitly discuss and test handling of an interface declaring methods that "override" public methods on java.lang.Object. Joe Darcy has updated the pull request incrementally with one additional commit since the last revision: Typo fix. ------------- Changes: - all: https://git.openjdk.org/jdk/pull/17564/files - new: https://git.openjdk.org/jdk/pull/17564/files/b800846f..f1e27bd4 Webrevs: - full: https://webrevs.openjdk.org/?repo=jdk&pr=17564&range=03 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=17564&range=02-03 Stats: 1 line in 1 file changed: 0 ins; 0 del; 1 mod Patch: https://git.openjdk.org/jdk/pull/17564.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/17564/head:pull/17564 PR: https://git.openjdk.org/jdk/pull/17564 From abimpoudis at openjdk.org Thu Jan 25 17:33:14 2024 From: abimpoudis at openjdk.org (Aggelos Biboudis) Date: Thu, 25 Jan 2024 17:33:14 GMT Subject: RFR: 8303374: Implement JEP 455: Primitive Types in Patterns, instanceof, and switch (Preview) [v53] 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 incrementally with one additional commit since the last revision: Tidy up Javadoc of Lower.visitTypeTest ------------- Changes: - all: https://git.openjdk.org/jdk/pull/15638/files - new: https://git.openjdk.org/jdk/pull/15638/files/b77d2316..44634684 Webrevs: - full: https://webrevs.openjdk.org/?repo=jdk&pr=15638&range=52 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=15638&range=51-52 Stats: 28 lines in 1 file changed: 9 ins; 5 del; 14 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 Thu Jan 25 17:46:07 2024 From: abimpoudis at openjdk.org (Aggelos Biboudis) Date: Thu, 25 Jan 2024 17:46:07 GMT Subject: RFR: 8303374: Implement JEP 455: Primitive Types in Patterns, instanceof, and switch (Preview) [v54] In-Reply-To: <4GCkSMggtYI8KnM-kELHez3Nd42WIrfd6jOF1bbK5PA=.12aec6f3-669b-4675-ad34-ffe28cb23459@github.com> References: <4GCkSMggtYI8KnM-kELHez3Nd42WIrfd6jOF1bbK5PA=.12aec6f3-669b-4675-ad34-ffe28cb23459@github.com> Message-ID: <0P6DMz53NNbzFireeMjPkayWCA93kTUGv0yAH9j-yP0=.27ec38d2-aa91-4aba-9d88-d94978d42abb@github.com> > 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 incrementally with one additional commit since the last revision: Small fix in Javadoc ------------- Changes: - all: https://git.openjdk.org/jdk/pull/15638/files - new: https://git.openjdk.org/jdk/pull/15638/files/44634684..854c20a1 Webrevs: - full: https://webrevs.openjdk.org/?repo=jdk&pr=15638&range=53 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=15638&range=52-53 Stats: 1 line in 1 file changed: 0 ins; 0 del; 1 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 darcy at openjdk.org Thu Jan 25 18:12:52 2024 From: darcy at openjdk.org (Joe Darcy) Date: Thu, 25 Jan 2024 18:12:52 GMT Subject: RFR: JDK-8302019: Clarify Elements.overrides [v5] In-Reply-To: References: Message-ID: <4t4-BAZNflto0d3cVaC-ve7M3prPDV7NzI-Pv2RgHhQ=.8554ab69-4be4-45ae-918f-921bf597f80d@github.com> > Explicitly discuss and test handling of an interface declaring methods that "override" public methods on java.lang.Object. Joe Darcy has updated the pull request incrementally with one additional commit since the last revision: Refine javadoc. ------------- Changes: - all: https://git.openjdk.org/jdk/pull/17564/files - new: https://git.openjdk.org/jdk/pull/17564/files/f1e27bd4..f60114a9 Webrevs: - full: https://webrevs.openjdk.org/?repo=jdk&pr=17564&range=04 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=17564&range=03-04 Stats: 4 lines in 1 file changed: 1 ins; 0 del; 3 mod Patch: https://git.openjdk.org/jdk/pull/17564.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/17564/head:pull/17564 PR: https://git.openjdk.org/jdk/pull/17564 From prappo at openjdk.org Thu Jan 25 19:04:36 2024 From: prappo at openjdk.org (Pavel Rappo) Date: Thu, 25 Jan 2024 19:04:36 GMT Subject: RFR: JDK-8302019: Clarify Elements.overrides [v5] In-Reply-To: <4t4-BAZNflto0d3cVaC-ve7M3prPDV7NzI-Pv2RgHhQ=.8554ab69-4be4-45ae-918f-921bf597f80d@github.com> References: <4t4-BAZNflto0d3cVaC-ve7M3prPDV7NzI-Pv2RgHhQ=.8554ab69-4be4-45ae-918f-921bf597f80d@github.com> Message-ID: On Thu, 25 Jan 2024 18:12:52 GMT, Joe Darcy wrote: >> Explicitly discuss and test handling of an interface declaring methods that "override" public methods on java.lang.Object. > > Joe Darcy has updated the pull request incrementally with one additional commit since the last revision: > > Refine javadoc. src/java.compiler/share/classes/javax/lang/model/util/Elements.java line 694: > 692: * public} method of {@link Object java.lang.Object}, this method treats > 693: * any such interface methods as overriding the corresponding {@code > 694: * Object} method; example: 1. It doesn't help comprehension when "method" means two things in a sentence at the same time: (i) ExecutableElement that models a method and (ii) the method the doc comment belongs to (i.e. Elements.overrides) and that takes ExecutableElement as its argument(s). I understand that it's always tricky in `javax.lang.model` domain, but still wonder if the sentence can be tweaked a bit. 2. "example:"? Would "for example:" be better? ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/17564#discussion_r1466804259 From prappo at openjdk.org Thu Jan 25 19:11:34 2024 From: prappo at openjdk.org (Pavel Rappo) Date: Thu, 25 Jan 2024 19:11:34 GMT Subject: RFR: JDK-8302019: Clarify Elements.overrides [v5] In-Reply-To: <4t4-BAZNflto0d3cVaC-ve7M3prPDV7NzI-Pv2RgHhQ=.8554ab69-4be4-45ae-918f-921bf597f80d@github.com> References: <4t4-BAZNflto0d3cVaC-ve7M3prPDV7NzI-Pv2RgHhQ=.8554ab69-4be4-45ae-918f-921bf597f80d@github.com> Message-ID: On Thu, 25 Jan 2024 18:12:52 GMT, Joe Darcy wrote: >> Explicitly discuss and test handling of an interface declaring methods that "override" public methods on java.lang.Object. > > Joe Darcy has updated the pull request incrementally with one additional commit since the last revision: > > Refine javadoc. Marked as reviewed by prappo (Reviewer). ------------- PR Review: https://git.openjdk.org/jdk/pull/17564#pullrequestreview-1844449684 From darcy at openjdk.org Thu Jan 25 19:21:51 2024 From: darcy at openjdk.org (Joe Darcy) Date: Thu, 25 Jan 2024 19:21:51 GMT Subject: RFR: JDK-8302019: Clarify Elements.overrides [v6] In-Reply-To: References: Message-ID: <8YtiqgrHfEwUYU2u-JDzK61RBn0GHMGKzr4F_W-frBw=.a19d7d26-e96b-4440-a0cf-56cc9aa74cc4@github.com> > Explicitly discuss and test handling of an interface declaring methods that "override" public methods on java.lang.Object. Joe Darcy has updated the pull request incrementally with one additional commit since the last revision: Respond to review feedback, update copyright year. ------------- Changes: - all: https://git.openjdk.org/jdk/pull/17564/files - new: https://git.openjdk.org/jdk/pull/17564/files/f60114a9..ff0bc887 Webrevs: - full: https://webrevs.openjdk.org/?repo=jdk&pr=17564&range=05 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=17564&range=04-05 Stats: 7 lines in 1 file changed: 1 ins; 0 del; 6 mod Patch: https://git.openjdk.org/jdk/pull/17564.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/17564/head:pull/17564 PR: https://git.openjdk.org/jdk/pull/17564 From jjg at openjdk.org Thu Jan 25 19:57:41 2024 From: jjg at openjdk.org (Jonathan Gibbons) Date: Thu, 25 Jan 2024 19:57:41 GMT Subject: RFR: JDK-8042981: Strip type annotations in Types' utility methods [v14] In-Reply-To: References: Message-ID: On Wed, 24 Jan 2024 06:08:44 GMT, Joe Darcy wrote: >> Early review for JDK-8042981: "Strip type annotations in Types' utility methods". I work more often in the Element world rather than the Type word of the annotation processing APIs. >> >> The type annotations on primitive types are *not* cleared by the existing annotation clearing mechanisms. I suspect Type.Visitor is missing a case for primitive types. Someone with familiarity with javac's type modeling should take a look; thanks. > > Joe Darcy has updated the pull request incrementally with one additional commit since the last revision: > > Better describe intentions of stripAnnotations method. LGTM. ------------- Marked as reviewed by jjg (Reviewer). PR Review: https://git.openjdk.org/jdk/pull/8984#pullrequestreview-1844572199 From jlahoda at openjdk.org Thu Jan 25 19:57:43 2024 From: jlahoda at openjdk.org (Jan Lahoda) Date: Thu, 25 Jan 2024 19:57:43 GMT Subject: RFR: JDK-8042981: Strip type annotations in Types' utility methods [v2] In-Reply-To: <7COyJ1b5X_1Z6ZlMJ-LaG8jxOlY6n9qwNWJ8Ry0uvFY=.72cd939d-b535-4114-a312-a70342cd8b6e@github.com> References: <7COyJ1b5X_1Z6ZlMJ-LaG8jxOlY6n9qwNWJ8Ry0uvFY=.72cd939d-b535-4114-a312-a70342cd8b6e@github.com> Message-ID: On Wed, 24 Jan 2024 01:26:01 GMT, Joe Darcy wrote: >> @jddarcy ? > > I don't think it is preserved in that case as much as a lookup/construction process is done based on the TypeElement, etc. > > So I think leaving the annotation behavior unspecified is okay. The `getDeclaredType` accepts `TypeMirror`s as the type arguments. I tried to invoke the method when this `TypeMirror` has an annotation, and the annotation is in the resulting `DeclaredType` as well. I don't mind this behavior, but my reading of the class' javadoc is that there should be no annotations, unless otherwise stated. And there does not seem to be anything in the `getDeclaredType` javadoc related to annotations on the type arguments, so the class' javadoc would apply. But maybe I miss something/read something wrong? ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/8984#discussion_r1466897048 From jjg at openjdk.org Thu Jan 25 20:04:35 2024 From: jjg at openjdk.org (Jonathan Gibbons) Date: Thu, 25 Jan 2024 20:04:35 GMT Subject: RFR: JDK-8302019: Clarify Elements.overrides [v6] In-Reply-To: <8YtiqgrHfEwUYU2u-JDzK61RBn0GHMGKzr4F_W-frBw=.a19d7d26-e96b-4440-a0cf-56cc9aa74cc4@github.com> References: <8YtiqgrHfEwUYU2u-JDzK61RBn0GHMGKzr4F_W-frBw=.a19d7d26-e96b-4440-a0cf-56cc9aa74cc4@github.com> Message-ID: On Thu, 25 Jan 2024 19:21:51 GMT, Joe Darcy wrote: >> Explicitly discuss and test handling of an interface declaring methods that "override" public methods on java.lang.Object. > > Joe Darcy has updated the pull request incrementally with one additional commit since the last revision: > > Respond to review feedback, update copyright year. src/java.compiler/share/classes/javax/lang/model/util/Elements.java line 706: > 704: * elementForObjecttoString, > 705: * elements.getTypeElement("I")); > 706: * This would be better as a `@snippet` (It's an archaic anti-pattern use of `

    `) ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/17564#discussion_r1466898015 From darcy at openjdk.org Thu Jan 25 20:39:49 2024 From: darcy at openjdk.org (Joe Darcy) Date: Thu, 25 Jan 2024 20:39:49 GMT Subject: RFR: JDK-8302019: Clarify Elements.overrides [v7] In-Reply-To: References: Message-ID: > Explicitly discuss and test handling of an interface declaring methods that "override" public methods on java.lang.Object. Joe Darcy has updated the pull request incrementally with one additional commit since the last revision: Update to use a snippet. ------------- Changes: - all: https://git.openjdk.org/jdk/pull/17564/files - new: https://git.openjdk.org/jdk/pull/17564/files/ff0bc887..a0d1c762 Webrevs: - full: https://webrevs.openjdk.org/?repo=jdk&pr=17564&range=06 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=17564&range=05-06 Stats: 3 lines in 1 file changed: 0 ins; 0 del; 3 mod Patch: https://git.openjdk.org/jdk/pull/17564.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/17564/head:pull/17564 PR: https://git.openjdk.org/jdk/pull/17564 From darcy at openjdk.org Thu Jan 25 20:39:51 2024 From: darcy at openjdk.org (Joe Darcy) Date: Thu, 25 Jan 2024 20:39:51 GMT Subject: RFR: JDK-8302019: Clarify Elements.overrides [v6] In-Reply-To: References: <8YtiqgrHfEwUYU2u-JDzK61RBn0GHMGKzr4F_W-frBw=.a19d7d26-e96b-4440-a0cf-56cc9aa74cc4@github.com> Message-ID: On Thu, 25 Jan 2024 19:55:47 GMT, Jonathan Gibbons wrote: >> Joe Darcy has updated the pull request incrementally with one additional commit since the last revision: >> >> Respond to review feedback, update copyright year. > > src/java.compiler/share/classes/javax/lang/model/util/Elements.java line 706: > >> 704: * elementForObjecttoString, >> 705: * elements.getTypeElement("I")); >> 706: *
    > > This would be better as a `@snippet` > (It's an archaic anti-pattern use of `
    `) Is there a way to have `@Override` represented in the snippet? I can give that a try. I don't think there is a strong need for this particular code and to be cut-and-pasted easily, but I can use more current features if possible. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/17564#discussion_r1466929706 From darcy at openjdk.org Thu Jan 25 20:39:51 2024 From: darcy at openjdk.org (Joe Darcy) Date: Thu, 25 Jan 2024 20:39:51 GMT Subject: RFR: JDK-8302019: Clarify Elements.overrides [v6] In-Reply-To: References: <8YtiqgrHfEwUYU2u-JDzK61RBn0GHMGKzr4F_W-frBw=.a19d7d26-e96b-4440-a0cf-56cc9aa74cc4@github.com> Message-ID: <2GbzfoUT4FZ8EKBcJs4iibjJd06LWKxlwFb0G4pJhZo=.21babaa0-f238-45e3-bc79-8590f46dbebe@github.com> On Thu, 25 Jan 2024 20:32:08 GMT, Joe Darcy wrote: >> src/java.compiler/share/classes/javax/lang/model/util/Elements.java line 706: >> >>> 704: * elementForObjecttoString, >>> 705: * elements.getTypeElement("I")); >>> 706: *
    >> >> This would be better as a `@snippet` >> (It's an archaic anti-pattern use of `
    `) > > Is there a way to have `@Override` represented in the snippet? I can give that a try. > > I don't think there is a strong need for this particular code and to be cut-and-pasted easily, but I can use more current features if possible. Snippet works; change pushed. Thanks. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/17564#discussion_r1466933929 From jjg at openjdk.org Thu Jan 25 21:18:34 2024 From: jjg at openjdk.org (Jonathan Gibbons) Date: Thu, 25 Jan 2024 21:18:34 GMT Subject: RFR: JDK-8302019: Clarify Elements.overrides [v6] In-Reply-To: <2GbzfoUT4FZ8EKBcJs4iibjJd06LWKxlwFb0G4pJhZo=.21babaa0-f238-45e3-bc79-8590f46dbebe@github.com> References: <8YtiqgrHfEwUYU2u-JDzK61RBn0GHMGKzr4F_W-frBw=.a19d7d26-e96b-4440-a0cf-56cc9aa74cc4@github.com> <2GbzfoUT4FZ8EKBcJs4iibjJd06LWKxlwFb0G4pJhZo=.21babaa0-f238-45e3-bc79-8590f46dbebe@github.com> Message-ID: On Thu, 25 Jan 2024 20:37:02 GMT, Joe Darcy wrote: >> Is there a way to have `@Override` represented in the snippet? I can give that a try. >> >> I don't think there is a strong need for this particular code and to be cut-and-pasted easily, but I can use more current features if possible. > > Snippet works; change pushed. Thanks. Annotations in snippets work as expected. A medium-while back we changed the rules for `@` inside inline tags so that `@` inside an inline tag does not prematurely terminate the inline tag and start a block tag. Thus, `@` can be used for annotations inside `{@snippet...}, `{@code ...}` and any other inline tag. Aside, FWIW, as a result of seeing your initial version, I did a repo-wide search for legacy use of `@` (used a long time ago to avoid the annotation/block-tag conflict.). The good news is that there are no other instances of `@` in OpenJDK, so we must have done a cleanup in times past. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/17564#discussion_r1466966705 From jjg at openjdk.org Thu Jan 25 21:18:36 2024 From: jjg at openjdk.org (Jonathan Gibbons) Date: Thu, 25 Jan 2024 21:18:36 GMT Subject: RFR: JDK-8302019: Clarify Elements.overrides [v6] In-Reply-To: References: <8YtiqgrHfEwUYU2u-JDzK61RBn0GHMGKzr4F_W-frBw=.a19d7d26-e96b-4440-a0cf-56cc9aa74cc4@github.com> <2GbzfoUT4FZ8EKBcJs4iibjJd06LWKxlwFb0G4pJhZo=.21babaa0-f238-45e3-bc79-8590f46dbebe@github.com> Message-ID: On Thu, 25 Jan 2024 21:13:54 GMT, Jonathan Gibbons wrote: >> Snippet works; change pushed. Thanks. > > Annotations in snippets work as expected. A medium-while back we changed the rules for `@` inside inline tags so that `@` inside an inline tag does not prematurely terminate the inline tag and start a block tag. Thus, `@` can be used for annotations inside `{@snippet...}, `{@code ...}` and any other inline tag. > > Aside, FWIW, as a result of seeing your initial version, I did a repo-wide search for legacy use of `@` (used a long time ago to avoid the annotation/block-tag conflict.). The good news is that there are no other instances of `@` in OpenJDK, so we must have done a cleanup in times past. While snippets do provide the ability to copy the code to the clipboard, they also provide stylistic consistency for the reader, which is good. And maybe one of these days, we'll add support for syntax highlighting ;-) ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/17564#discussion_r1466968330 From darcy at openjdk.org Thu Jan 25 21:35:54 2024 From: darcy at openjdk.org (Joe Darcy) Date: Thu, 25 Jan 2024 21:35:54 GMT Subject: RFR: JDK-8042981: Strip type annotations in Types' utility methods [v15] In-Reply-To: References: Message-ID: > Early review for JDK-8042981: "Strip type annotations in Types' utility methods". I work more often in the Element world rather than the Type word of the annotation processing APIs. > > The type annotations on primitive types are *not* cleared by the existing annotation clearing mechanisms. I suspect Type.Visitor is missing a case for primitive types. Someone with familiarity with javac's type modeling should take a look; thanks. Joe Darcy has updated the pull request incrementally with one additional commit since the last revision: Update spec and tests for getDeclaredType ------------- Changes: - all: https://git.openjdk.org/jdk/pull/8984/files - new: https://git.openjdk.org/jdk/pull/8984/files/aa9154b2..e5ccaa71 Webrevs: - full: https://webrevs.openjdk.org/?repo=jdk&pr=8984&range=14 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=8984&range=13-14 Stats: 12 lines in 2 files changed: 12 ins; 0 del; 0 mod Patch: https://git.openjdk.org/jdk/pull/8984.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/8984/head:pull/8984 PR: https://git.openjdk.org/jdk/pull/8984 From darcy at openjdk.org Thu Jan 25 21:35:54 2024 From: darcy at openjdk.org (Joe Darcy) Date: Thu, 25 Jan 2024 21:35:54 GMT Subject: RFR: JDK-8042981: Strip type annotations in Types' utility methods [v2] In-Reply-To: References: <7COyJ1b5X_1Z6ZlMJ-LaG8jxOlY6n9qwNWJ8Ry0uvFY=.72cd939d-b535-4114-a312-a70342cd8b6e@github.com> Message-ID: On Thu, 25 Jan 2024 19:54:53 GMT, Jan Lahoda wrote: >> I don't think it is preserved in that case as much as a lookup/construction process is done based on the TypeElement, etc. >> >> So I think leaving the annotation behavior unspecified is okay. > > The `getDeclaredType` accepts `TypeMirror`s as the type arguments. I tried to invoke the method when this `TypeMirror` has an annotation, and the annotation is in the resulting `DeclaredType` as well. I don't mind this behavior, but my reading of the class' javadoc is that there should be no annotations, unless otherwise stated. And there does not seem to be anything in the `getDeclaredType` javadoc related to annotations on the type arguments, so the class' javadoc would apply. But maybe I miss something/read something wrong? Ah, right; the type arguments. I was thinking of the root return type. Specification and tests updated. Thanks. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/8984#discussion_r1466983878 From prappo at openjdk.org Thu Jan 25 21:41:35 2024 From: prappo at openjdk.org (Pavel Rappo) Date: Thu, 25 Jan 2024 21:41:35 GMT Subject: RFR: JDK-8302019: Clarify Elements.overrides [v7] In-Reply-To: References: Message-ID: On Thu, 25 Jan 2024 20:39:49 GMT, Joe Darcy wrote: >> Explicitly discuss and test handling of an interface declaring methods that "override" public methods on java.lang.Object. > > Joe Darcy has updated the pull request incrementally with one additional commit since the last revision: > > Update to use a snippet. Marked as reviewed by prappo (Reviewer). ------------- PR Review: https://git.openjdk.org/jdk/pull/17564#pullrequestreview-1844726617 From acobbs at openjdk.org Thu Jan 25 21:41:36 2024 From: acobbs at openjdk.org (Archie Cobbs) Date: Thu, 25 Jan 2024 21:41:36 GMT Subject: RFR: JDK-8302019: Clarify Elements.overrides [v6] In-Reply-To: References: <8YtiqgrHfEwUYU2u-JDzK61RBn0GHMGKzr4F_W-frBw=.a19d7d26-e96b-4440-a0cf-56cc9aa74cc4@github.com> <2GbzfoUT4FZ8EKBcJs4iibjJd06LWKxlwFb0G4pJhZo=.21babaa0-f238-45e3-bc79-8590f46dbebe@github.com> Message-ID: On Thu, 25 Jan 2024 21:16:00 GMT, Jonathan Gibbons wrote: >> Annotations in snippets work as expected. A medium-while back we changed the rules for `@` inside inline tags so that `@` inside an inline tag does not prematurely terminate the inline tag and start a block tag. Thus, `@` can be used for annotations inside `{@snippet...}, `{@code ...}` and any other inline tag. >> >> Aside, FWIW, as a result of seeing your initial version, I did a repo-wide search for legacy use of `@` (used a long time ago to avoid the annotation/block-tag conflict.). The good news is that there are no other instances of `@` in OpenJDK, so we must have done a cleanup in times past. > > While snippets do provide the ability to copy the code to the clipboard, they also provide stylistic consistency for the reader, which is good. And maybe one of these days, we'll add support for syntax highlighting ;-) > Aside, FWIW, as a result of seeing your initial version, I did a repo-wide search for legacy use of `@` (used a long time ago to avoid the annotation/block-tag conflict.). The good news is that there are no other instances of `@` in OpenJDK, so we must have done a cleanup in times past. (drive by comment) One would also need to also look for `@` which is still found in 15 files. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/17564#discussion_r1466988820 From jjg at openjdk.org Thu Jan 25 22:13:37 2024 From: jjg at openjdk.org (Jonathan Gibbons) Date: Thu, 25 Jan 2024 22:13:37 GMT Subject: RFR: JDK-8302019: Clarify Elements.overrides [v7] In-Reply-To: References: Message-ID: On Thu, 25 Jan 2024 20:39:49 GMT, Joe Darcy wrote: >> Explicitly discuss and test handling of an interface declaring methods that "override" public methods on java.lang.Object. > > Joe Darcy has updated the pull request incrementally with one additional commit since the last revision: > > Update to use a snippet. Marked as reviewed by jjg (Reviewer). ------------- PR Review: https://git.openjdk.org/jdk/pull/17564#pullrequestreview-1844769139 From jjg at openjdk.org Thu Jan 25 22:13:39 2024 From: jjg at openjdk.org (Jonathan Gibbons) Date: Thu, 25 Jan 2024 22:13:39 GMT Subject: RFR: JDK-8302019: Clarify Elements.overrides [v6] In-Reply-To: References: <8YtiqgrHfEwUYU2u-JDzK61RBn0GHMGKzr4F_W-frBw=.a19d7d26-e96b-4440-a0cf-56cc9aa74cc4@github.com> <2GbzfoUT4FZ8EKBcJs4iibjJd06LWKxlwFb0G4pJhZo=.21babaa0-f238-45e3-bc79-8590f46dbebe@github.com> Message-ID: <_HPyoGYLt02DjZjuOv_wV7MCP0PF3iZOnAEzwnAKHjU=.7d4c7ad2-6d8b-434e-bd0b-bfa3a0347066@github.com> On Thu, 25 Jan 2024 21:38:31 GMT, Archie Cobbs wrote: >> While snippets do provide the ability to copy the code to the clipboard, they also provide stylistic consistency for the reader, which is good. And maybe one of these days, we'll add support for syntax highlighting ;-) > >> Aside, FWIW, as a result of seeing your initial version, I did a repo-wide search for legacy use of `@` (used a long time ago to avoid the annotation/block-tag conflict.). The good news is that there are no other instances of `@` in OpenJDK, so we must have done a cleanup in times past. > > (drive by comment) One would also need to also look for `@` which is still found in 15 files. @archiecobbs Thanks for that; I'll file an JBS issue to fix them ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/17564#discussion_r1467017031 From jjg at openjdk.org Thu Jan 25 22:19:38 2024 From: jjg at openjdk.org (Jonathan Gibbons) Date: Thu, 25 Jan 2024 22:19:38 GMT Subject: RFR: JDK-8302019: Clarify Elements.overrides [v6] In-Reply-To: <_HPyoGYLt02DjZjuOv_wV7MCP0PF3iZOnAEzwnAKHjU=.7d4c7ad2-6d8b-434e-bd0b-bfa3a0347066@github.com> References: <8YtiqgrHfEwUYU2u-JDzK61RBn0GHMGKzr4F_W-frBw=.a19d7d26-e96b-4440-a0cf-56cc9aa74cc4@github.com> <2GbzfoUT4FZ8EKBcJs4iibjJd06LWKxlwFb0G4pJhZo=.21babaa0-f238-45e3-bc79-8590f46dbebe@github.com> <_HPyoGYLt02DjZjuOv_wV7MCP0PF3iZOnAEzwnAKHjU=.7d4c7ad2-6d8b-434e-bd0b-bfa3a0347066@github.com> Message-ID: <2Q2BbxwqUa5wYxRUyCqBr59wGAcjf-aJ4btXgki2jYQ=.4a7d049c-6136-48cb-b4fd-03e453970ba5@github.com> On Thu, 25 Jan 2024 22:11:33 GMT, Jonathan Gibbons wrote: >>> Aside, FWIW, as a result of seeing your initial version, I did a repo-wide search for legacy use of `@` (used a long time ago to avoid the annotation/block-tag conflict.). The good news is that there are no other instances of `@` in OpenJDK, so we must have done a cleanup in times past. >> >> (drive by comment) One would also need to also look for `@` which is still found in 15 files. > > @archiecobbs Thanks for that; I'll file an JBS issue to fix them I count 55 instances in 15 files in 5 modules, although not all are in public APIs ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/17564#discussion_r1467020053 From darcy at openjdk.org Thu Jan 25 22:19:40 2024 From: darcy at openjdk.org (Joe Darcy) Date: Thu, 25 Jan 2024 22:19:40 GMT Subject: Integrated: JDK-8302019: Clarify Elements.overrides In-Reply-To: References: Message-ID: On Thu, 25 Jan 2024 02:37:33 GMT, Joe Darcy wrote: > Explicitly discuss and test handling of an interface declaring methods that "override" public methods on java.lang.Object. This pull request has now been integrated. Changeset: b5995a76 Author: Joe Darcy URL: https://git.openjdk.org/jdk/commit/b5995a76f79e0a70e67b0915e782e881efbbdf5e Stats: 132 lines in 2 files changed: 131 ins; 0 del; 1 mod 8302019: Clarify Elements.overrides Reviewed-by: prappo, jjg ------------- PR: https://git.openjdk.org/jdk/pull/17564 From jjg at openjdk.org Thu Jan 25 22:39:39 2024 From: jjg at openjdk.org (Jonathan Gibbons) Date: Thu, 25 Jan 2024 22:39:39 GMT Subject: RFR: JDK-8042981: Strip type annotations in Types' utility methods [v15] In-Reply-To: References: Message-ID: On Thu, 25 Jan 2024 21:35:54 GMT, Joe Darcy wrote: >> Early review for JDK-8042981: "Strip type annotations in Types' utility methods". I work more often in the Element world rather than the Type word of the annotation processing APIs. >> >> The type annotations on primitive types are *not* cleared by the existing annotation clearing mechanisms. I suspect Type.Visitor is missing a case for primitive types. Someone with familiarity with javac's type modeling should take a look; thanks. > > Joe Darcy has updated the pull request incrementally with one additional commit since the last revision: > > Update spec and tests for getDeclaredType Approved, but suggest waiting for @lahodaj as well. src/java.compiler/share/classes/javax/lang/model/util/Types.java line 270: > 268: * Given the type element for {@code Set} and the type mirror > 269: * for {@code String}, > 270: * for example, this method may be used to get the While unrelated to this change, if you cam, I would suggest moving `for example` to the beginning of the sentence, to give the reader more context for the text that follows: > For example, given the type element for {@code Set} and a type mirror for {@code String}, > this method may be used to get the parameterized type {@code Set}. ------------- Marked as reviewed by jjg (Reviewer). PR Review: https://git.openjdk.org/jdk/pull/8984#pullrequestreview-1844797947 PR Review Comment: https://git.openjdk.org/jdk/pull/8984#discussion_r1467034294 From prappo at openjdk.org Fri Jan 26 17:39:43 2024 From: prappo at openjdk.org (Pavel Rappo) Date: Fri, 26 Jan 2024 17:39:43 GMT Subject: RFR: JDK-8298405: Support Markdown in Documentation Comments [v7] In-Reply-To: <0pRMUgBnvCfb7DTm_pDnIlmuYdXH8URKFAIk5cT082Y=.f4c324b6-ef98-41b3-9b06-9cb82e03b08f@github.com> References: <0pRMUgBnvCfb7DTm_pDnIlmuYdXH8URKFAIk5cT082Y=.f4c324b6-ef98-41b3-9b06-9cb82e03b08f@github.com> Message-ID: On Fri, 19 Jan 2024 18:37:48 GMT, Jonathan Gibbons wrote: >> Please review a patch to add support for Markdown syntax in documentation comments, as described in the associated JEP. >> >> Notable features: >> >> * support for `///` documentation comments in `JavaTokenizer` >> * new module `jdk.internal.md` -- a private copy of the `commonmark-java` library >> * updates to `DocCommentParser` to treat `///` comments as Markdown >> * updates to the standard doclet to render Markdown comments in HTML > > Jonathan Gibbons has updated the pull request with a new target base due to a merge or a rebase. The pull request now contains eight commits: > > - Merge with upstream/master > - Merge with upstream/master > - Merge remote-tracking branch 'upstream/master' into 8298405.doclet-markdown-v3 > - Address review comments > - Fix whitespace > - Improve handling of embedded inline taglets > - Customize support for Markdown headings > - JDK-8298405: Support Markdown in Documentation Comments src/jdk.internal.md/share/classes/jdk/internal/markdown/MarkdownTransformer.java line 668: > 666: * U+FFFC characters that were found in the original document. > 667: */ > 668: Iterator replaceIter; Suggestion: final Iterator replaceIter; src/jdk.internal.md/share/classes/jdk/internal/markdown/MarkdownTransformer.java line 732: > 730: offsets.add(m.end()); > 731: } > 732: sourceLineOffsets = offsets.stream().mapToInt(Integer::intValue).toArray(); Here's an alternative, which you might find better (or not): Suggestion: sourceLineOffsets = Stream.concat(Stream.of(0), lineBreak.matcher(source).results() .map(MatchResult::end)).mapToInt(Integer::intValue).toArray(); src/jdk.internal.md/share/classes/jdk/internal/markdown/MarkdownTransformer.java line 763: > 761: * > 762: * @param link the link node > 763: */ Suggestion: /** * Visits a {@code Link} commonmark node. * * If the destination for the link begins with {@code code:} * convert it to {@code {@link ...}} or {@code {@linkplain ...}} doc tree node. * {@code {@link ...}} will be used if the content (label) for * the link is the same as the reference found after the {@code code:}; * otherwise, {@code {@linkplain ...}} will be used. * * The label will be left blank for {@code {@link ...}} nodes, * implying that a default label should be used, based on the * program element that was referenced. * * @param link the link node */ src/jdk.internal.md/share/classes/jdk/internal/markdown/MarkdownTransformer.java line 778: > 776: copyTo(getEndPos(link.getLastChild())); > 777: > 778: // determine whether to use {@link... } or {@linkplain ...} Nit: Suggestion: // determine whether to use {@link ... } or {@linkplain ...} src/jdk.internal.md/share/classes/jdk/internal/markdown/MarkdownTransformer.java line 831: > 829: /** > 830: * {@return the position in the original comment for a position in {@code source}, > 831: * using {@link #replaceAdjustPos}}. Suggestion: * using {@link #replaceAdjustPos}} src/jdk.internal.md/share/classes/jdk/internal/markdown/MarkdownTransformer.java line 840: > 838: > 839: /** > 840: * Process a node and any children. Suggestion: * Processes a node and any children. src/jdk.internal.md/share/classes/jdk/internal/markdown/MarkdownTransformer.java line 939: > 937: > 938: /** > 939: * Flush any text in the {@code text} buffer, by creating a new Suggestion: * Flushes any text in the {@code text} buffer, by creating a new src/jdk.internal.md/share/classes/jdk/internal/markdown/MarkdownTransformer.java line 950: > 948: } > 949: > 950: Suggestion: ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/16388#discussion_r1467870392 PR Review Comment: https://git.openjdk.org/jdk/pull/16388#discussion_r1467870182 PR Review Comment: https://git.openjdk.org/jdk/pull/16388#discussion_r1467643549 PR Review Comment: https://git.openjdk.org/jdk/pull/16388#discussion_r1467871256 PR Review Comment: https://git.openjdk.org/jdk/pull/16388#discussion_r1467876796 PR Review Comment: https://git.openjdk.org/jdk/pull/16388#discussion_r1467871714 PR Review Comment: https://git.openjdk.org/jdk/pull/16388#discussion_r1467872096 PR Review Comment: https://git.openjdk.org/jdk/pull/16388#discussion_r1467872597 From jlahoda at openjdk.org Fri Jan 26 17:57:39 2024 From: jlahoda at openjdk.org (Jan Lahoda) Date: Fri, 26 Jan 2024 17:57:39 GMT Subject: RFR: JDK-8042981: Strip type annotations in Types' utility methods [v15] In-Reply-To: References: Message-ID: On Thu, 25 Jan 2024 21:35:54 GMT, Joe Darcy wrote: >> Early review for JDK-8042981: "Strip type annotations in Types' utility methods". I work more often in the Element world rather than the Type word of the annotation processing APIs. >> >> The type annotations on primitive types are *not* cleared by the existing annotation clearing mechanisms. I suspect Type.Visitor is missing a case for primitive types. Someone with familiarity with javac's type modeling should take a look; thanks. > > Joe Darcy has updated the pull request incrementally with one additional commit since the last revision: > > Update spec and tests for getDeclaredType Just for completeness, the `getDeclaredType` method has two overloads, so maybe the second overload should get the note that it preserves the annotations as well. No need for re-review. ------------- Marked as reviewed by jlahoda (Reviewer). PR Review: https://git.openjdk.org/jdk/pull/8984#pullrequestreview-1846236174 From abimpoudis at openjdk.org Fri Jan 26 18:02:58 2024 From: abimpoudis at openjdk.org (Aggelos Biboudis) Date: Fri, 26 Jan 2024 18:02:58 GMT Subject: RFR: 8303374: Implement JEP 455: Primitive Types in Patterns, instanceof, and switch (Preview) [v55] 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 incrementally with one additional commit since the last revision: Remove redundant null check and introduce a const boolean for unconditionally exact pairs ------------- Changes: - all: https://git.openjdk.org/jdk/pull/15638/files - new: https://git.openjdk.org/jdk/pull/15638/files/854c20a1..e466cfba Webrevs: - full: https://webrevs.openjdk.org/?repo=jdk&pr=15638&range=54 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=15638&range=53-54 Stats: 12 lines in 1 file changed: 0 ins; 9 del; 3 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 acobbs at openjdk.org Fri Jan 26 18:37:49 2024 From: acobbs at openjdk.org (Archie Cobbs) Date: Fri, 26 Jan 2024 18:37:49 GMT Subject: RFR: 8324736: Invalid end positions for EMPTY_STATEMENT Message-ID: In the fix for [JDK-8305671](https://bugs.openjdk.org/browse/JDK-8305671), an `EMPTY_STATEMENT` representing a lone semicolon was being created with the wrong source code position. The bug was that the starting position needed to be captured prior to advancing to the next token, not after. ------------- Commit messages: - Fix bug where source positions got reversed. Changes: https://git.openjdk.org/jdk/pull/17595/files Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=17595&range=00 Issue: https://bugs.openjdk.org/browse/JDK-8324736 Stats: 87 lines in 2 files changed: 86 ins; 0 del; 1 mod Patch: https://git.openjdk.org/jdk/pull/17595.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/17595/head:pull/17595 PR: https://git.openjdk.org/jdk/pull/17595 From darcy at openjdk.org Fri Jan 26 20:04:55 2024 From: darcy at openjdk.org (Joe Darcy) Date: Fri, 26 Jan 2024 20:04:55 GMT Subject: RFR: JDK-8042981: Strip type annotations in Types' utility methods [v16] In-Reply-To: References: Message-ID: <2XznoonaMS_MyZmeaRRfj7k0jYNH50ZrxjLJtuNszgM=.3b25359c-23f6-434f-ae25-732e1ac15964@github.com> > Early review for JDK-8042981: "Strip type annotations in Types' utility methods". I work more often in the Element world rather than the Type word of the annotation processing APIs. > > The type annotations on primitive types are *not* cleared by the existing annotation clearing mechanisms. I suspect Type.Visitor is missing a case for primitive types. Someone with familiarity with javac's type modeling should take a look; thanks. Joe Darcy has updated the pull request incrementally with one additional commit since the last revision: Add spec update to overloaded method. ------------- Changes: - all: https://git.openjdk.org/jdk/pull/8984/files - new: https://git.openjdk.org/jdk/pull/8984/files/e5ccaa71..ef6e1e64 Webrevs: - full: https://webrevs.openjdk.org/?repo=jdk&pr=8984&range=15 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=8984&range=14-15 Stats: 2 lines in 1 file changed: 2 ins; 0 del; 0 mod Patch: https://git.openjdk.org/jdk/pull/8984.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/8984/head:pull/8984 PR: https://git.openjdk.org/jdk/pull/8984 From darcy at openjdk.org Fri Jan 26 20:48:42 2024 From: darcy at openjdk.org (Joe Darcy) Date: Fri, 26 Jan 2024 20:48:42 GMT Subject: RFR: JDK-8042981: Strip type annotations in Types' utility methods [v17] In-Reply-To: References: Message-ID: > Early review for JDK-8042981: "Strip type annotations in Types' utility methods". I work more often in the Element world rather than the Type word of the annotation processing APIs. > > The type annotations on primitive types are *not* cleared by the existing annotation clearing mechanisms. I suspect Type.Visitor is missing a case for primitive types. Someone with familiarity with javac's type modeling should take a look; thanks. Joe Darcy has updated the pull request incrementally with one additional commit since the last revision: Add test cases. ------------- Changes: - all: https://git.openjdk.org/jdk/pull/8984/files - new: https://git.openjdk.org/jdk/pull/8984/files/ef6e1e64..425516af Webrevs: - full: https://webrevs.openjdk.org/?repo=jdk&pr=8984&range=16 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=8984&range=15-16 Stats: 24 lines in 1 file changed: 19 ins; 0 del; 5 mod Patch: https://git.openjdk.org/jdk/pull/8984.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/8984/head:pull/8984 PR: https://git.openjdk.org/jdk/pull/8984 From darcy at openjdk.org Fri Jan 26 20:58:44 2024 From: darcy at openjdk.org (Joe Darcy) Date: Fri, 26 Jan 2024 20:58:44 GMT Subject: Integrated: JDK-8042981: Strip type annotations in Types' utility methods In-Reply-To: References: Message-ID: On Thu, 2 Jun 2022 01:09:17 GMT, Joe Darcy wrote: > Early review for JDK-8042981: "Strip type annotations in Types' utility methods". I work more often in the Element world rather than the Type word of the annotation processing APIs. > > The type annotations on primitive types are *not* cleared by the existing annotation clearing mechanisms. I suspect Type.Visitor is missing a case for primitive types. Someone with familiarity with javac's type modeling should take a look; thanks. This pull request has now been integrated. Changeset: ed3272cc Author: Joe Darcy URL: https://git.openjdk.org/jdk/commit/ed3272cc44a5b1ae918b573e6c3d792665b6bbc7 Stats: 449 lines in 5 files changed: 438 ins; 0 del; 11 mod 8042981: Strip type annotations in Types' utility methods Co-authored-by: Liam Miller-Cushon Reviewed-by: cushon, jjg, jlahoda ------------- PR: https://git.openjdk.org/jdk/pull/8984 From darcy at openjdk.org Fri Jan 26 21:02:53 2024 From: darcy at openjdk.org (Joe Darcy) Date: Fri, 26 Jan 2024 21:02:53 GMT Subject: RFR: JDK-8175386: Clarify exception behavior of Types utility methods [v4] In-Reply-To: References: Message-ID: > Incremental improvements and clarifications in the specification of Types. Joe Darcy 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 four additional commits since the last revision: - Merge branch 'master' into JDK-8175386 - Implement review feedback. - Fix typo found in code review. - JDK-8175386: Clarify exception behavior of Types utility methods ------------- Changes: - all: https://git.openjdk.org/jdk/pull/17523/files - new: https://git.openjdk.org/jdk/pull/17523/files/9aa3b2fa..c7433074 Webrevs: - full: https://webrevs.openjdk.org/?repo=jdk&pr=17523&range=03 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=17523&range=02-03 Stats: 4985 lines in 319 files changed: 3563 ins; 691 del; 731 mod Patch: https://git.openjdk.org/jdk/pull/17523.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/17523/head:pull/17523 PR: https://git.openjdk.org/jdk/pull/17523 From jjg at openjdk.org Fri Jan 26 21:14:18 2024 From: jjg at openjdk.org (Jonathan Gibbons) Date: Fri, 26 Jan 2024 21:14:18 GMT Subject: RFR: JDK-8298405: Support Markdown in Documentation Comments [v8] In-Reply-To: References: Message-ID: > Please review a patch to add support for Markdown syntax in documentation comments, as described in the associated JEP. > > Notable features: > > * support for `///` documentation comments in `JavaTokenizer` > * new module `jdk.internal.md` -- a private copy of the `commonmark-java` library > * updates to `DocCommentParser` to treat `///` comments as Markdown > * updates to the standard doclet to render Markdown comments in HTML Jonathan Gibbons has updated the pull request with a new target base due to a merge or a rebase. The pull request now contains ten commits: - Merge remote-tracking branch 'upstream/master' into 8298405.doclet-markdown-v3 - Merge with upstream/master - Merge with upstream/master - Merge remote-tracking branch 'upstream/master' into 8298405.doclet-markdown-v3 - Address review comments - Fix whitespace - Improve handling of embedded inline taglets - Customize support for Markdown headings - JDK-8298405: Support Markdown in Documentation Comments ------------- Changes: https://git.openjdk.org/jdk/pull/16388/files Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=16388&range=07 Stats: 21334 lines in 191 files changed: 20679 ins; 266 del; 389 mod Patch: https://git.openjdk.org/jdk/pull/16388.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/16388/head:pull/16388 PR: https://git.openjdk.org/jdk/pull/16388 From jjg at openjdk.org Fri Jan 26 21:24:26 2024 From: jjg at openjdk.org (Jonathan Gibbons) Date: Fri, 26 Jan 2024 21:24:26 GMT Subject: RFR: JDK-8175386: Clarify exception behavior of Types utility methods [v4] In-Reply-To: References: Message-ID: On Fri, 26 Jan 2024 21:02:53 GMT, Joe Darcy wrote: >> Incremental improvements and clarifications in the specification of Types. > > Joe Darcy 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 four additional commits since the last revision: > > - Merge branch 'master' into JDK-8175386 > - Implement review feedback. > - Fix typo found in code review. > - JDK-8175386: Clarify exception behavior of Types utility methods Marked as reviewed by jjg (Reviewer). src/java.compiler/share/classes/javax/lang/model/util/Types.java line 48: > 46: * methods. One or more out of scope arguments will typically result > 47: * in a method throwing an {@link IllegalArgumentException > 48: * IllegalArgumentException}. Nit: do you need the second argument? It should be the default string. ------------- PR Review: https://git.openjdk.org/jdk/pull/17523#pullrequestreview-1846568129 PR Review Comment: https://git.openjdk.org/jdk/pull/17523#discussion_r1468158159 From darcy at openjdk.org Fri Jan 26 21:54:33 2024 From: darcy at openjdk.org (Joe Darcy) Date: Fri, 26 Jan 2024 21:54:33 GMT Subject: RFR: JDK-8175386: Clarify exception behavior of Types utility methods [v4] In-Reply-To: References: Message-ID: On Fri, 26 Jan 2024 21:21:06 GMT, Jonathan Gibbons wrote: >> Joe Darcy 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 four additional commits since the last revision: >> >> - Merge branch 'master' into JDK-8175386 >> - Implement review feedback. >> - Fix typo found in code review. >> - JDK-8175386: Clarify exception behavior of Types utility methods > > src/java.compiler/share/classes/javax/lang/model/util/Types.java line 48: > >> 46: * methods. One or more out of scope arguments will typically result >> 47: * in a method throwing an {@link IllegalArgumentException >> 48: * IllegalArgumentException}. > > Nit: do you need the second argument? It should be the default string. I'll check if "java.lang" is inserted without the second argument. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/17523#discussion_r1468181148 From darcy at openjdk.org Fri Jan 26 22:22:46 2024 From: darcy at openjdk.org (Joe Darcy) Date: Fri, 26 Jan 2024 22:22:46 GMT Subject: RFR: JDK-8175386: Clarify exception behavior of Types utility methods [v5] In-Reply-To: References: Message-ID: > Incremental improvements and clarifications in the specification of Types. Joe Darcy has updated the pull request incrementally with one additional commit since the last revision: Implement review feedback. ------------- Changes: - all: https://git.openjdk.org/jdk/pull/17523/files - new: https://git.openjdk.org/jdk/pull/17523/files/c7433074..3c995e51 Webrevs: - full: https://webrevs.openjdk.org/?repo=jdk&pr=17523&range=04 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=17523&range=03-04 Stats: 2 lines in 1 file changed: 0 ins; 1 del; 1 mod Patch: https://git.openjdk.org/jdk/pull/17523.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/17523/head:pull/17523 PR: https://git.openjdk.org/jdk/pull/17523 From darcy at openjdk.org Fri Jan 26 22:36:40 2024 From: darcy at openjdk.org (Joe Darcy) Date: Fri, 26 Jan 2024 22:36:40 GMT Subject: Integrated: JDK-8175386: Clarify exception behavior of Types utility methods In-Reply-To: References: Message-ID: <7AR1jJ93RAi3a-EzKwa_E2PBQBtSI5j_ZFF0jW-4LUg=.b6a59224-0ba7-421b-85b1-bfcda778b86b@github.com> On Mon, 22 Jan 2024 21:51:57 GMT, Joe Darcy wrote: > Incremental improvements and clarifications in the specification of Types. This pull request has now been integrated. Changeset: 2e748c99 Author: Joe Darcy URL: https://git.openjdk.org/jdk/commit/2e748c998ee490d8c3b1c7ab2fadfcb4596fc07b Stats: 17 lines in 1 file changed: 15 ins; 0 del; 2 mod 8175386: Clarify exception behavior of Types utility methods Reviewed-by: jjg ------------- PR: https://git.openjdk.org/jdk/pull/17523 From jlahoda at openjdk.org Mon Jan 29 16:18:53 2024 From: jlahoda at openjdk.org (Jan Lahoda) Date: Mon, 29 Jan 2024 16:18:53 GMT Subject: RFR: 8303374: Implement JEP 455: Primitive Types in Patterns, instanceof, and switch (Preview) [v55] In-Reply-To: References: <4GCkSMggtYI8KnM-kELHez3Nd42WIrfd6jOF1bbK5PA=.12aec6f3-669b-4675-ad34-ffe28cb23459@github.com> Message-ID: <8lRWOKmFWcWkgP5XCyXZGacvbtPRdco7AyVyJ4aVhNs=.afbba2a2-6757-4129-965e-f6c4609e8304@github.com> On Fri, 26 Jan 2024 18:02:58 GMT, Aggelos Biboudis wrote: >> 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 incrementally with one additional commit since the last revision: > > Remove redundant null check and introduce a const boolean for unconditionally exact pairs javac changes look sensible to me - some minor comments inline. src/jdk.compiler/share/classes/com/sun/tools/javac/code/Types.java line 5040: > 5038: * @param target Target primitive or reference type > 5039: */ > 5040: public boolean checkUnconditionallyExact(Type source, Type target) { Maybe something like `isUnconditionallyExact`? src/jdk.compiler/share/classes/com/sun/tools/javac/code/Types.java line 5060: > 5058: * @param targetType Target type > 5059: */ > 5060: public boolean checkUnconditionallyExactPrimitives(Type selectorType, Type targetType) { Maybe something like `isUnconditionallyExactPrimitives`? src/jdk.compiler/share/classes/com/sun/tools/javac/comp/Attr.java line 1799: > 1797: log.error(label.pos(), Errors.UnconditionalPatternAndDefault); > 1798: } else if (booleanSwitch && constants.containsAll(Set.of(0, 1))) { > 1799: log.error(label.pos(), Errors.UnconditionalPatternAndDefault); // TODO improve error Maybe file a follow-up to improve the error? src/jdk.compiler/share/classes/com/sun/tools/javac/comp/Lower.java line 3079: > 3077: > 3078: // Resolve the exactness method > 3079: Symbol ecsym = rs.resolveQualifiedMethod(null, Minor: better use `rs.resolveInternalMethod` or `this.lookupMethod`, so that the compilation fails more obviously if the method cannot be found. test/langtools/tools/javac/diags/examples/NotApplicableTypes.java line 21: > 19: * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA > 20: * or visit www.oracle.com if you need additional information or have any > 21: * questions. The key does not exist any, per my understanding. I would suggest to simply delete the file. test/langtools/tools/javac/diags/examples/SelectorTypeNotAllowed.java line 24: > 22: */ > 23: > 24: // key: compiler.err.preview.feature.disabled.plural The key does not exist any, per my understanding. I would suggest to simply delete the file. ------------- Marked as reviewed by jlahoda (Reviewer). PR Review: https://git.openjdk.org/jdk/pull/15638#pullrequestreview-1848712425 PR Review Comment: https://git.openjdk.org/jdk/pull/15638#discussion_r1469805646 PR Review Comment: https://git.openjdk.org/jdk/pull/15638#discussion_r1469806136 PR Review Comment: https://git.openjdk.org/jdk/pull/15638#discussion_r1469614384 PR Review Comment: https://git.openjdk.org/jdk/pull/15638#discussion_r1469811642 PR Review Comment: https://git.openjdk.org/jdk/pull/15638#discussion_r1469838360 PR Review Comment: https://git.openjdk.org/jdk/pull/15638#discussion_r1469838529 From vromero at openjdk.org Mon Jan 29 20:27:46 2024 From: vromero at openjdk.org (Vicente Romero) Date: Mon, 29 Jan 2024 20:27:46 GMT Subject: RFR: 8303374: Implement JEP 455: Primitive Types in Patterns, instanceof, and switch (Preview) [v55] In-Reply-To: References: <4GCkSMggtYI8KnM-kELHez3Nd42WIrfd6jOF1bbK5PA=.12aec6f3-669b-4675-ad34-ffe28cb23459@github.com> Message-ID: <7kcOKMS7ryi8yOLlyzjgRW7cK0aJzFIQHpqoRsV_sB4=.1caaf2cc-860a-44c3-9180-79b7df7ab7f2@github.com> On Fri, 26 Jan 2024 18:02:58 GMT, Aggelos Biboudis wrote: >> 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 incrementally with one additional commit since the last revision: > > Remove redundant null check and introduce a const boolean for unconditionally exact pairs lgtm ------------- Marked as reviewed by vromero (Reviewer). PR Review: https://git.openjdk.org/jdk/pull/15638#pullrequestreview-1849695360 From jjg at openjdk.org Mon Jan 29 21:16:59 2024 From: jjg at openjdk.org (Jonathan Gibbons) Date: Mon, 29 Jan 2024 21:16:59 GMT Subject: RFR: JDK-8298405: Support Markdown in Documentation Comments [v9] In-Reply-To: References: Message-ID: > Please review a patch to add support for Markdown syntax in documentation comments, as described in the associated JEP. > > Notable features: > > * support for `///` documentation comments in `JavaTokenizer` > * new module `jdk.internal.md` -- a private copy of the `commonmark-java` library > * updates to `DocCommentParser` to treat `///` comments as Markdown > * updates to the standard doclet to render Markdown comments in HTML Jonathan Gibbons has updated the pull request with a new target base due to a merge or a rebase. The pull request now contains 10 commits: - Merge remote-tracking branch 'upstream/master' into 8298405.doclet-markdown-v3 - Merge remote-tracking branch 'upstream/master' into 8298405.doclet-markdown-v3 - Merge with upstream/master - Merge with upstream/master - Merge remote-tracking branch 'upstream/master' into 8298405.doclet-markdown-v3 - Address review comments - Fix whitespace - Improve handling of embedded inline taglets - Customize support for Markdown headings - JDK-8298405: Support Markdown in Documentation Comments ------------- Changes: https://git.openjdk.org/jdk/pull/16388/files Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=16388&range=08 Stats: 21334 lines in 191 files changed: 20679 ins; 266 del; 389 mod Patch: https://git.openjdk.org/jdk/pull/16388.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/16388/head:pull/16388 PR: https://git.openjdk.org/jdk/pull/16388 From jjg at openjdk.org Mon Jan 29 22:14:42 2024 From: jjg at openjdk.org (Jonathan Gibbons) Date: Mon, 29 Jan 2024 22:14:42 GMT Subject: RFR: JDK-8164094: javadoc allows to create a @link to a non-existent method [v2] In-Reply-To: <81GrAewa5NKD4xg8oTdTzr3X_whVENpiaI-aUbUHMC8=.9c18fc4d-155d-4825-9d72-1fda0c0ff66c@github.com> References: <-xM8YSleEZ-CQY1FwsTvPsgYW3s8GmkOkGi-9r8icuI=.da06c781-54fe-463a-abd7-c714e4d3982f@github.com> <_pikP7s04dGw96fPV2zU1ONXSPGQoZo4SRfYNifChBM=.00cf8f90-bb98-4ca2-9dc0-1a77d76462b6@github.com> <81GrAewa5NKD4xg8oTdTzr3X_whVENpiaI-aUbUHMC8=.9c18fc4d-155d-4825-9d72-1fda0c0ff66c@github.com> Message-ID: <8M-Q1_V6QTLNtS503174G4CFD87BNmavK8kPijRV3Nc=.9a957e2e-b9c4-4ffe-bd6c-2399fc96e5cf@github.com> On Wed, 13 Dec 2023 14:53:57 GMT, Pavel Rappo wrote: >>> Should this issue have a CSR for the behavioral change? >> >> My understanding of the issue is that the lookup of explicit-class member references in enclosing classes was an unintended consequence of doing the same for classless references from within nested classes. So I consider this a bug fix, not a feature change (even though it unfortunately changes javadoc to become stricter in what it accepts). >> >> Actually, the feature of extending member reference lookup to enclosing classes is not specified in the taglet spec, which only says this: >> >>> When the reference is to a member of the same class as that containing the documentation comment, all parts of the reference up to and including the # may be omitted, although the '#' may be retained for clarity. >> >> This could be extended to include enclosing classes, but this is existing behaviour, not changed by this issue. > > @hns would you be able to create a linked bug to track that lookup order issue? I note the preceding discussion including @pavelrappo's notes about order of lookup, and the separate issue to pursue this further. It's also not clear to me that the statement in the description is "right": _but @see Inner#method() should not_ If `Inner.method()` has a meaning (making allowances for `static` or not, etc) in nearby code, then shouldn't `Inner#method()` have a similar meaning? I think that we should 1. determine the lexical scope for the doc comment 2. follow the JLS rules as much as possible, with matching examples for doc comments and Java code as much as possible 3. clearly specify that doc comment names follow the JLS rules, except when they're not, and clearly specify any exceptions to those rules All that is out of scope for here, and can be handled in [JDK-8324320](https://bugs.openjdk.org/browse/JDK-8324320), so I have one last question before I add my approval (or Pavel can lower the `/reviewer` count): Does this change affect the published/latest JDK API documentation in any way? I'm guessing not, but we've been surprised before. ------------- PR Comment: https://git.openjdk.org/jdk/pull/17069#issuecomment-1915665305 From jjg at openjdk.org Mon Jan 29 22:45:44 2024 From: jjg at openjdk.org (Jonathan Gibbons) Date: Mon, 29 Jan 2024 22:45:44 GMT Subject: RFR: JDK-8298405: Support Markdown in Documentation Comments [v2] In-Reply-To: References: <0xaWRD1add432FW4NF8dhU3gi3q6BzPbhdnSMWKs2CY=.6ed27293-a889-4802-8e3f-e9f5d0a030e2@github.com> Message-ID: On Wed, 17 Jan 2024 00:13:40 GMT, Jonathan Gibbons wrote: >> Understood. FWIW, here are a few examples of headings in user-defined tags in JDK: >> >> https://github.com/openjdk/jdk/blob/a6785e4d633908596ddb6de6d2eeab1c9ebdf2c3/src/java.base/share/classes/java/math/BigDecimal.java#L229-L239 >> >> https://github.com/openjdk/jdk/blob/ddbbd36e4b064b9e7433f0a55973d72cd6dbc0d3/src/java.xml/share/classes/module-info.java#L402-L420 >> >> https://github.com/openjdk/jdk/blob/6f6486e97743eadfb20b4175e1b4b2b05b59a17a/src/jdk.incubator.vector/share/classes/jdk/incubator/vector/Vector.java#L1089-L1093 > > Thanks for the examples. > > Stylistically, they are maybe questionable. But we can make sure that something sensible happens, and deal with stylistic issues later. Filed [JDK-8324876](https://bugs.openjdk.org/browse/JDK-8324876) to reconsider these tags. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/16388#discussion_r1470321290 From jjg at openjdk.org Mon Jan 29 22:49:46 2024 From: jjg at openjdk.org (Jonathan Gibbons) Date: Mon, 29 Jan 2024 22:49:46 GMT Subject: RFR: JDK-8298405: Support Markdown in Documentation Comments [v6] In-Reply-To: References: <0mlIFIZ2ec8oE2zlmKxoMwp59dBgOdUQs-vzTLnU7hI=.15fa2827-8c87-415b-ab74-0e42b45a5cf7@github.com> Message-ID: On Fri, 12 Jan 2024 12:08:19 GMT, Pavel Rappo wrote: >> Jonathan Gibbons 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 seven additional commits since the last revision: >> >> - Merge with upstream/master >> - Merge remote-tracking branch 'upstream/master' into 8298405.doclet-markdown-v3 >> - Address review comments >> - Fix whitespace >> - Improve handling of embedded inline taglets >> - Customize support for Markdown headings >> - JDK-8298405: Support Markdown in Documentation Comments > > src/jdk.internal.md/share/classes/module-info.java line 29: > >> 27: * Internal support for Markdown. >> 28: * >> 29: * @since 22 > > Suggestion: > > * @since 23 fixed ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/16388#discussion_r1470324945 From jjg at openjdk.org Mon Jan 29 23:04:32 2024 From: jjg at openjdk.org (Jonathan Gibbons) Date: Mon, 29 Jan 2024 23:04:32 GMT Subject: RFR: JDK-8298405: Support Markdown in Documentation Comments [v6] In-Reply-To: <6df9dQzBK0M7SlHDpNO4T_bhE7i6WqwLP64cs6Df9A8=.e08f76a3-8753-4bad-9325-b0ab042645a4@github.com> References: <0mlIFIZ2ec8oE2zlmKxoMwp59dBgOdUQs-vzTLnU7hI=.15fa2827-8c87-415b-ab74-0e42b45a5cf7@github.com> <6df9dQzBK0M7SlHDpNO4T_bhE7i6WqwLP64cs6Df9A8=.e08f76a3-8753-4bad-9325-b0ab042645a4@github.com> Message-ID: <0LBA9kWWGHD3jfYp5BD-pagDJ502nqoAv2jJg09Zs9o=.ac7495cc-6c94-4e6e-93fd-92464762f29b@github.com> On Fri, 12 Jan 2024 14:28:45 GMT, Pavel Rappo wrote: >> Jonathan Gibbons 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 seven additional commits since the last revision: >> >> - Merge with upstream/master >> - Merge remote-tracking branch 'upstream/master' into 8298405.doclet-markdown-v3 >> - Address review comments >> - Fix whitespace >> - Improve handling of embedded inline taglets >> - Customize support for Markdown headings >> - JDK-8298405: Support Markdown in Documentation Comments > > src/jdk.compiler/share/classes/com/sun/source/util/DocTrees.java line 97: > >> 95: */ >> 96: public enum CommentKind { >> 97: /** The style of comments whose lines are prefixed by{@code ///}. */ > > Suggestion: > > /** The style of comments whose lines are prefixed by {@code ///}. */ Fixed ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/16388#discussion_r1470340279 From jjg at openjdk.org Mon Jan 29 23:07:38 2024 From: jjg at openjdk.org (Jonathan Gibbons) Date: Mon, 29 Jan 2024 23:07:38 GMT Subject: RFR: JDK-8298405: Support Markdown in Documentation Comments [v6] In-Reply-To: <6df9dQzBK0M7SlHDpNO4T_bhE7i6WqwLP64cs6Df9A8=.e08f76a3-8753-4bad-9325-b0ab042645a4@github.com> References: <0mlIFIZ2ec8oE2zlmKxoMwp59dBgOdUQs-vzTLnU7hI=.15fa2827-8c87-415b-ab74-0e42b45a5cf7@github.com> <6df9dQzBK0M7SlHDpNO4T_bhE7i6WqwLP64cs6Df9A8=.e08f76a3-8753-4bad-9325-b0ab042645a4@github.com> Message-ID: On Fri, 12 Jan 2024 15:20:56 GMT, Pavel Rappo wrote: >> Jonathan Gibbons 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 seven additional commits since the last revision: >> >> - Merge with upstream/master >> - Merge remote-tracking branch 'upstream/master' into 8298405.doclet-markdown-v3 >> - Address review comments >> - Fix whitespace >> - Improve handling of embedded inline taglets >> - Customize support for Markdown headings >> - JDK-8298405: Support Markdown in Documentation Comments > > src/jdk.compiler/share/classes/com/sun/source/util/DocTreeFactory.java line 303: > >> 301: * @since 22 >> 302: */ >> 303: RawTextTree newRawTextTree(DocTree.Kind kind, String code) throws IllegalArgumentException; > > It's unusual for a JDK method to declare a runtime exception. removed; there is an `@throws` for the exception; that is enough ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/16388#discussion_r1470342549 From jjg at openjdk.org Mon Jan 29 23:19:36 2024 From: jjg at openjdk.org (Jonathan Gibbons) Date: Mon, 29 Jan 2024 23:19:36 GMT Subject: RFR: JDK-8298405: Support Markdown in Documentation Comments [v6] In-Reply-To: References: <0mlIFIZ2ec8oE2zlmKxoMwp59dBgOdUQs-vzTLnU7hI=.15fa2827-8c87-415b-ab74-0e42b45a5cf7@github.com> <6df9dQzBK0M7SlHDpNO4T_bhE7i6WqwLP64cs6Df9A8=.e08f76a3-8753-4bad-9325-b0ab042645a4@github.com> Message-ID: On Wed, 17 Jan 2024 00:24:01 GMT, Jonathan Gibbons wrote: >> src/jdk.compiler/share/classes/com/sun/source/doctree/RawTextTree.java line 40: >> >>> 38: * @apiNote >>> 39: * This class may be used to represent tree nodes containing >>> 40: * {@linkplain DocTree.Kind#MARKDOWN Markdown} text. >> >> This means that there is one-to-many relationship between `RawTextTree` and `DocTree.KIND`. This in turn perpetuates the pattern of checking the kind followed by casting as opposed to more modern `instanceof` pattern matching. There's nothing wrong with it per se, however I wonder what the rationale is for leaving this part of the API open-ended. Is it to support other types of raw text in the future? > > Yes, the thinking was to allow it to be open-ended. > > In this case, while I think we should specify the ability to use `instanceof`-style checks with this API, I do not think it would be necessary ... there is no need for a subtype for `MarkdownTree`, nor would I expect there to be one for any other kind of raw text. Related: filed [JDK-8324877](https://bugs.openjdk.org/browse/JDK-8324877) to better specify the 1-1 relationship between subtypes of `DocTree` and members of `DocTree.Kind` ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/16388#discussion_r1470351155 From jjg at openjdk.org Mon Jan 29 23:19:42 2024 From: jjg at openjdk.org (Jonathan Gibbons) Date: Mon, 29 Jan 2024 23:19:42 GMT Subject: RFR: JDK-8298405: Support Markdown in Documentation Comments [v6] In-Reply-To: <6df9dQzBK0M7SlHDpNO4T_bhE7i6WqwLP64cs6Df9A8=.e08f76a3-8753-4bad-9325-b0ab042645a4@github.com> References: <0mlIFIZ2ec8oE2zlmKxoMwp59dBgOdUQs-vzTLnU7hI=.15fa2827-8c87-415b-ab74-0e42b45a5cf7@github.com> <6df9dQzBK0M7SlHDpNO4T_bhE7i6WqwLP64cs6Df9A8=.e08f76a3-8753-4bad-9325-b0ab042645a4@github.com> Message-ID: <_Bn8h9_cccQpycmJm4bBotvZP15JZDW68zLad29IGPg=.c200821c-04b1-481f-afdb-e73424fd648d@github.com> On Fri, 12 Jan 2024 16:02:12 GMT, Pavel Rappo wrote: >> Jonathan Gibbons 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 seven additional commits since the last revision: >> >> - Merge with upstream/master >> - Merge remote-tracking branch 'upstream/master' into 8298405.doclet-markdown-v3 >> - Address review comments >> - Fix whitespace >> - Improve handling of embedded inline taglets >> - Customize support for Markdown headings >> - JDK-8298405: Support Markdown in Documentation Comments > > src/jdk.compiler/share/classes/com/sun/source/util/DocTrees.java line 104: > >> 102: >> 103: /** >> 104: * {@return the style of the documentation comment associated with a tree node.} > > Period is redundant: > Suggestion: > > * {@return the style of the documentation comment associated with a tree node} fixed ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/16388#discussion_r1470353416 From jjg at openjdk.org Mon Jan 29 23:30:47 2024 From: jjg at openjdk.org (Jonathan Gibbons) Date: Mon, 29 Jan 2024 23:30:47 GMT Subject: RFR: JDK-8298405: Support Markdown in Documentation Comments [v6] In-Reply-To: <6df9dQzBK0M7SlHDpNO4T_bhE7i6WqwLP64cs6Df9A8=.e08f76a3-8753-4bad-9325-b0ab042645a4@github.com> References: <0mlIFIZ2ec8oE2zlmKxoMwp59dBgOdUQs-vzTLnU7hI=.15fa2827-8c87-415b-ab74-0e42b45a5cf7@github.com> <6df9dQzBK0M7SlHDpNO4T_bhE7i6WqwLP64cs6Df9A8=.e08f76a3-8753-4bad-9325-b0ab042645a4@github.com> Message-ID: On Fri, 12 Jan 2024 16:49:31 GMT, Pavel Rappo wrote: >> Jonathan Gibbons 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 seven additional commits since the last revision: >> >> - Merge with upstream/master >> - Merge remote-tracking branch 'upstream/master' into 8298405.doclet-markdown-v3 >> - Address review comments >> - Fix whitespace >> - Improve handling of embedded inline taglets >> - Customize support for Markdown headings >> - JDK-8298405: Support Markdown in Documentation Comments > > src/jdk.compiler/share/classes/com/sun/source/util/DocTrees.java line 157: > >> 155: * @param fileObject the content container >> 156: * @return the doc comment tree >> 157: * @throws IllegalArgumentException if the file type is not supported > > It seems like this exception could've been thrown before, it's just that you have documented it for the first time. This might be important for CSR. It's effectively a new exception, since before this work, we simply assumed that any file being read was in HTML format. Now, we check the file type, as described in the modified doc comment. The entire doc comment is subject to CSR. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/16388#discussion_r1470362514 From jjg at openjdk.org Mon Jan 29 23:38:31 2024 From: jjg at openjdk.org (Jonathan Gibbons) Date: Mon, 29 Jan 2024 23:38:31 GMT Subject: RFR: JDK-8298405: Support Markdown in Documentation Comments [v6] In-Reply-To: <6df9dQzBK0M7SlHDpNO4T_bhE7i6WqwLP64cs6Df9A8=.e08f76a3-8753-4bad-9325-b0ab042645a4@github.com> References: <0mlIFIZ2ec8oE2zlmKxoMwp59dBgOdUQs-vzTLnU7hI=.15fa2827-8c87-415b-ab74-0e42b45a5cf7@github.com> <6df9dQzBK0M7SlHDpNO4T_bhE7i6WqwLP64cs6Df9A8=.e08f76a3-8753-4bad-9325-b0ab042645a4@github.com> Message-ID: On Mon, 15 Jan 2024 12:30:09 GMT, Pavel Rappo wrote: >> Jonathan Gibbons 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 seven additional commits since the last revision: >> >> - Merge with upstream/master >> - Merge remote-tracking branch 'upstream/master' into 8298405.doclet-markdown-v3 >> - Address review comments >> - Fix whitespace >> - Improve handling of embedded inline taglets >> - Customize support for Markdown headings >> - JDK-8298405: Support Markdown in Documentation Comments > > src/jdk.compiler/share/classes/com/sun/tools/javac/parser/DocCommentParser.java line 215: > >> 213: case '\n', '\r' -> { >> 214: return newString(bp, p); >> 215: } > > Hm... this does not seem to be consistent with `newline` in `nextChar`; should it be consistent? I think it is OK, isn't it? In both cases, a newline sequence can begin with `\r` or `\n`. In this `peekLine` method, we only want the content up to but not including the newline, so there is no need to handle the possibility of `\r\n`. In `nextChar`, we do want to detect `r` and `\r\n` and treat both as equivalent to `\n`. Or am I missing something? > src/jdk.compiler/share/classes/com/sun/tools/javac/parser/DocCommentParser.java line 241: > >> 239: *
  • {@code PREAMBLE}: the appearance of {@code } (or {@code
    }), >> 240: * as determined by {@link #isEndPreamble()} >> 241: *
  • {@code BODY}: the beginning of a block tag, or when readung from > > Suggestion: > > *
  • {@code BODY}: the beginning of a block tag, or when reading from fixed > src/jdk.compiler/share/classes/com/sun/tools/javac/parser/DocCommentParser.java line 249: > >> 247: * >> 248: * >> 249: * > > Suggestion: fixed > src/jdk.compiler/share/classes/com/sun/tools/javac/parser/DocCommentParser.java line 1000: > >> 998: *
  • cdata: {@code } >> 999: * >> 1000: * or > > Dangling "or". Oops. fixed. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/16388#discussion_r1470367971 PR Review Comment: https://git.openjdk.org/jdk/pull/16388#discussion_r1470369401 PR Review Comment: https://git.openjdk.org/jdk/pull/16388#discussion_r1470368948 PR Review Comment: https://git.openjdk.org/jdk/pull/16388#discussion_r1470368478 From abimpoudis at openjdk.org Mon Jan 29 23:53:08 2024 From: abimpoudis at openjdk.org (Aggelos Biboudis) Date: Mon, 29 Jan 2024 23:53:08 GMT Subject: RFR: 8303374: Implement JEP 455: Primitive Types in Patterns, instanceof, and switch (Preview) [v56] 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 incrementally with one additional commit since the last revision: Address review by Jan ------------- Changes: - all: https://git.openjdk.org/jdk/pull/15638/files - new: https://git.openjdk.org/jdk/pull/15638/files/e466cfba..8c27c5c0 Webrevs: - full: https://webrevs.openjdk.org/?repo=jdk&pr=15638&range=55 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=15638&range=54-55 Stats: 165 lines in 12 files changed: 78 ins; 68 del; 19 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 jjg at openjdk.org Mon Jan 29 23:53:44 2024 From: jjg at openjdk.org (Jonathan Gibbons) Date: Mon, 29 Jan 2024 23:53:44 GMT Subject: RFR: JDK-8298405: Support Markdown in Documentation Comments [v6] In-Reply-To: References: <0mlIFIZ2ec8oE2zlmKxoMwp59dBgOdUQs-vzTLnU7hI=.15fa2827-8c87-415b-ab74-0e42b45a5cf7@github.com> <6df9dQzBK0M7SlHDpNO4T_bhE7i6WqwLP64cs6Df9A8=.e08f76a3-8753-4bad-9325-b0ab042645a4@github.com> Message-ID: <4Tqtmfv4DzkI4sbb6bLBY9Ll0xd34vm9KBUzthu3fd8=.2e94fa19-e555-4371-bd2e-8506938527e8@github.com> On Wed, 17 Jan 2024 00:25:37 GMT, Jonathan Gibbons wrote: >> src/jdk.compiler/share/classes/com/sun/tools/javac/parser/DocCommentParser.java line 89: >> >>> 87: POSTAMBLE, >>> 88: /** The rich-text content of an inline documentation comment tag. */ >>> 89: INLINE >> >> Do we also need to say something about `.md` files here? > > Probably, yes. New class comment added. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/16388#discussion_r1470380797 From jjg at openjdk.org Tue Jan 30 00:05:46 2024 From: jjg at openjdk.org (Jonathan Gibbons) Date: Tue, 30 Jan 2024 00:05:46 GMT Subject: RFR: JDK-8298405: Support Markdown in Documentation Comments [v6] In-Reply-To: References: <0mlIFIZ2ec8oE2zlmKxoMwp59dBgOdUQs-vzTLnU7hI=.15fa2827-8c87-415b-ab74-0e42b45a5cf7@github.com> Message-ID: On Mon, 15 Jan 2024 16:13:38 GMT, Pavel Rappo wrote: >> Jonathan Gibbons 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 seven additional commits since the last revision: >> >> - Merge with upstream/master >> - Merge remote-tracking branch 'upstream/master' into 8298405.doclet-markdown-v3 >> - Address review comments >> - Fix whitespace >> - Improve handling of embedded inline taglets >> - Customize support for Markdown headings >> - JDK-8298405: Support Markdown in Documentation Comments > > src/jdk.compiler/share/classes/com/sun/tools/javac/parser/DocCommentParser.java line 1295: > >> 1293: switch (ch) { >> 1294: case ' ' -> indent++; >> 1295: case '\t' -> indent = 4; > > Shouldn't it be like this or it does not matter? > ```suggestion > case '\t' -> indent += 4; I did mean `indent = 4`. It would not mean `indent +=4` because you would have to take preceding character count into account, to round up to a multiple of 4. But anyway, it's enough to know the indent is 4 or more, meaning the code is looking at an indented code block. https://spec.commonmark.org/0.30/#indented-code-blocks ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/16388#discussion_r1470390472 From jjg at openjdk.org Tue Jan 30 00:31:43 2024 From: jjg at openjdk.org (Jonathan Gibbons) Date: Tue, 30 Jan 2024 00:31:43 GMT Subject: RFR: JDK-8298405: Support Markdown in Documentation Comments [v5] In-Reply-To: References: <5D_gyGHDR52UTLCcFnUNSWYXjYgcy3jYnffOXZ70xsg=.e1389d08-c9ae-481f-9c53-1ccd1e389102@github.com> Message-ID: On Wed, 22 Nov 2023 09:37:04 GMT, Andrey Turbanov wrote: >> Jonathan Gibbons has updated the pull request incrementally with one additional commit since the last revision: >> >> Address review comments > > src/jdk.compiler/share/classes/com/sun/tools/javac/parser/DocCommentParser.java line 178: > >> 176: List postamble = isHtmlFile ? content(Phase.POSTAMBLE) : List.nil(); >> 177: >> 178: int pos = textKind == DocTree.Kind.MARKDOWN ? 0 > > Suggestion: > > int pos = textKind == DocTree.Kind.MARKDOWN ? 0 fixed ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/16388#discussion_r1470411957 From jjg at openjdk.org Tue Jan 30 00:31:46 2024 From: jjg at openjdk.org (Jonathan Gibbons) Date: Tue, 30 Jan 2024 00:31:46 GMT Subject: RFR: JDK-8298405: Support Markdown in Documentation Comments [v6] In-Reply-To: References: <0mlIFIZ2ec8oE2zlmKxoMwp59dBgOdUQs-vzTLnU7hI=.15fa2827-8c87-415b-ab74-0e42b45a5cf7@github.com> Message-ID: On Mon, 15 Jan 2024 18:08:54 GMT, Pavel Rappo wrote: >> Jonathan Gibbons 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 seven additional commits since the last revision: >> >> - Merge with upstream/master >> - Merge remote-tracking branch 'upstream/master' into 8298405.doclet-markdown-v3 >> - Address review comments >> - Fix whitespace >> - Improve handling of embedded inline taglets >> - Customize support for Markdown headings >> - JDK-8298405: Support Markdown in Documentation Comments > > src/jdk.compiler/share/classes/com/sun/tools/javac/parser/DocCommentParser.java line 1336: > >> 1334: switch (initialLineKind) { >> 1335: case CODE_FENCE -> { >> 1336: if (lineKind == LineKind.CODE_FENCE && ch == term && count(ch) == count) { > > https://spec.commonmark.org/0.30/#example-124 shows that the closing fence may be longer than the opening one: consider `count(ch) >= count`. > > That said, I note that on my experiment the resulting output was identical with or without the change I ask you to consider. Perhaps I haven't yet understood how the parsing works. Good catch. The spec has the words: _and with at least as many backticks or tildes_ Will fix. > src/jdk.compiler/share/classes/com/sun/tools/javac/parser/DocCommentParser.java line 1421: > >> 1419: case '#', '=', '-', '+', '_', '`', '~' -> { >> 1420: String line = peekLine(); >> 1421: for (LineKind lk : LineKind.values()) { > > Nothing wrong here, just noting that this is one more way one can depend on an enum constant order. Change it, and a peeked line kind might change too (e.g. `OTHER` matches everything.) Like it or not, JLS defines that enum members are ordered, and even has an example 8.9.3-1 of using the `values` method in an enhanced `for` loop. Any change to the order of the members of any enum has the potential to be a breaking change and should never be done lightly. Curiously, JLS 13.4.26 does not say that reordering enum constants may break clients. Anyway, I added comments to the LineKind enum declaration. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/16388#discussion_r1470410143 PR Review Comment: https://git.openjdk.org/jdk/pull/16388#discussion_r1470408047 From jjg at openjdk.org Tue Jan 30 00:36:48 2024 From: jjg at openjdk.org (Jonathan Gibbons) Date: Tue, 30 Jan 2024 00:36:48 GMT Subject: RFR: JDK-8298405: Support Markdown in Documentation Comments [v6] In-Reply-To: References: <0mlIFIZ2ec8oE2zlmKxoMwp59dBgOdUQs-vzTLnU7hI=.15fa2827-8c87-415b-ab74-0e42b45a5cf7@github.com> Message-ID: <0Hd6nB-tCMmyw_kKynscXZOOOdOfxYoahOQ8ATPTPuQ=.cbd6411a-4b71-4be9-bc69-2745af2ca198@github.com> On Mon, 15 Jan 2024 17:35:00 GMT, Pavel Rappo wrote: >> Jonathan Gibbons 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 seven additional commits since the last revision: >> >> - Merge with upstream/master >> - Merge remote-tracking branch 'upstream/master' into 8298405.doclet-markdown-v3 >> - Address review comments >> - Fix whitespace >> - Improve handling of embedded inline taglets >> - Customize support for Markdown headings >> - JDK-8298405: Support Markdown in Documentation Comments > > src/jdk.compiler/share/classes/com/sun/tools/javac/parser/DocCommentParser.java line 1377: > >> 1375: * @see ATX Headings >> 1376: */ >> 1377: ATX_HEADER(Pattern.compile("#{1,6}( .*|$)")), > > Nothing wrong here, I just didn't know that an ATX header "opening sequence of # characters" can be followed by the end of line". Interesting. :-) I think this comes in the general category of the _principle of least surprise and no errors_. The only other possibility would be to treat it as an ordinary line starting with `#` characters. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/16388#discussion_r1470419341 From jjg at openjdk.org Tue Jan 30 00:42:47 2024 From: jjg at openjdk.org (Jonathan Gibbons) Date: Tue, 30 Jan 2024 00:42:47 GMT Subject: RFR: JDK-8298405: Support Markdown in Documentation Comments [v6] In-Reply-To: References: <0mlIFIZ2ec8oE2zlmKxoMwp59dBgOdUQs-vzTLnU7hI=.15fa2827-8c87-415b-ab74-0e42b45a5cf7@github.com> Message-ID: On Fri, 19 Jan 2024 11:38:56 GMT, Pavel Rappo wrote: >> Jonathan Gibbons 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 seven additional commits since the last revision: >> >> - Merge with upstream/master >> - Merge remote-tracking branch 'upstream/master' into 8298405.doclet-markdown-v3 >> - Address review comments >> - Fix whitespace >> - Improve handling of embedded inline taglets >> - Customize support for Markdown headings >> - JDK-8298405: Support Markdown in Documentation Comments > > src/jdk.compiler/share/classes/com/sun/tools/javac/parser/DocCommentParser.java line 259: > >> 257: LineKind lineKind = textKind == DocTree.Kind.MARKDOWN ? peekLineKind() : null; >> 258: >> 259: if (DEBUG) System.err.println("starting content " + showPos(bp) + " " + newline); > > Debug output is useful. I wonder if we should consider https://openjdk.org/jeps/264. My oops for leaving the code in, or at least not cleaning it up more. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/16388#discussion_r1470424344 From jjg at openjdk.org Tue Jan 30 00:50:45 2024 From: jjg at openjdk.org (Jonathan Gibbons) Date: Tue, 30 Jan 2024 00:50:45 GMT Subject: RFR: JDK-8298405: Support Markdown in Documentation Comments [v6] In-Reply-To: References: <0mlIFIZ2ec8oE2zlmKxoMwp59dBgOdUQs-vzTLnU7hI=.15fa2827-8c87-415b-ab74-0e42b45a5cf7@github.com> <6df9dQzBK0M7SlHDpNO4T_bhE7i6WqwLP64cs6Df9A8=.e08f76a3-8753-4bad-9325-b0ab042645a4@github.com> Message-ID: <5BjUOMWcopR-ouu-BVzMiDNUU5uZTFBhS4E0orGR9H4=.cb1112d1-7832-428f-b485-c417798248ab@github.com> On Fri, 19 Jan 2024 16:59:04 GMT, Pavel Rappo wrote: > Musing on this more. > > Can/should we, without introducing probably unwelcome `Kind.MD` to `javax.tools.JavaFileObject.Kind`, teach javac to recognise `package.md` similarly to how it recognises legacy `package.html`? If we are aiming for Markdown to be a drop in replacement for traditional javadoc comments, we might want to go the extra mile. > > I'm pleased to see that Markdown `-overview` files work just fine. No. There are times to let go of legacy behavior, and even if this is not the time to remove support for `package.html`, there is no reason to go backwards and support `package.md`. The preferred replacement for `package.html` has long been `package-info.java` and you can put Markdown content in that file with no issues. In similar fashion, remember the recent discussion as to whether we should support `@deprecated` in Markdown comments as marking the declaration as _deprecated_, even without the `@Deprecated` annotation. The general consensus was to not persist with that legacy behavior. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/16388#discussion_r1470430534 From jjg at openjdk.org Tue Jan 30 01:03:53 2024 From: jjg at openjdk.org (Jonathan Gibbons) Date: Tue, 30 Jan 2024 01:03:53 GMT Subject: RFR: JDK-8298405: Support Markdown in Documentation Comments [v10] In-Reply-To: References: Message-ID: > Please review a patch to add support for Markdown syntax in documentation comments, as described in the associated JEP. > > Notable features: > > * support for `///` documentation comments in `JavaTokenizer` > * new module `jdk.internal.md` -- a private copy of the `commonmark-java` library > * updates to `DocCommentParser` to treat `///` comments as Markdown > * updates to the standard doclet to render Markdown comments in HTML Jonathan Gibbons has updated the pull request incrementally with two additional commits since the last revision: - fix @since tags - fix copyright year ------------- Changes: - all: https://git.openjdk.org/jdk/pull/16388/files - new: https://git.openjdk.org/jdk/pull/16388/files/4d22a100..5e3f03c8 Webrevs: - full: https://webrevs.openjdk.org/?repo=jdk&pr=16388&range=09 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=16388&range=08-09 Stats: 13 lines in 9 files changed: 0 ins; 0 del; 13 mod Patch: https://git.openjdk.org/jdk/pull/16388.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/16388/head:pull/16388 PR: https://git.openjdk.org/jdk/pull/16388 From abimpoudis at openjdk.org Tue Jan 30 08:33:49 2024 From: abimpoudis at openjdk.org (Aggelos Biboudis) Date: Tue, 30 Jan 2024 08:33:49 GMT Subject: RFR: 8303374: Implement JEP 455: Primitive Types in Patterns, instanceof, and switch (Preview) [v55] In-Reply-To: <8lRWOKmFWcWkgP5XCyXZGacvbtPRdco7AyVyJ4aVhNs=.afbba2a2-6757-4129-965e-f6c4609e8304@github.com> References: <4GCkSMggtYI8KnM-kELHez3Nd42WIrfd6jOF1bbK5PA=.12aec6f3-669b-4675-ad34-ffe28cb23459@github.com> <8lRWOKmFWcWkgP5XCyXZGacvbtPRdco7AyVyJ4aVhNs=.afbba2a2-6757-4129-965e-f6c4609e8304@github.com> Message-ID: On Mon, 29 Jan 2024 16:16:00 GMT, Jan Lahoda wrote: >> Aggelos Biboudis has updated the pull request incrementally with one additional commit since the last revision: >> >> Remove redundant null check and introduce a const boolean for unconditionally exact pairs > > javac changes look sensible to me - some minor comments inline. Thx for all the comments @lahodaj @mcimadamore @vicente-romero-oracle @rgiulietti @jddarcy ? Addressed all @lahodaj ------------- PR Comment: https://git.openjdk.org/jdk/pull/15638#issuecomment-1916314623 From jlahoda at openjdk.org Tue Jan 30 10:07:28 2024 From: jlahoda at openjdk.org (Jan Lahoda) Date: Tue, 30 Jan 2024 10:07:28 GMT Subject: RFR: 8303374: Implement JEP 455: Primitive Types in Patterns, instanceof, and switch (Preview) [v56] In-Reply-To: References: <4GCkSMggtYI8KnM-kELHez3Nd42WIrfd6jOF1bbK5PA=.12aec6f3-669b-4675-ad34-ffe28cb23459@github.com> Message-ID: On Mon, 29 Jan 2024 23:53:08 GMT, Aggelos Biboudis wrote: >> 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 incrementally with one additional commit since the last revision: > > Address review by Jan lgtm ------------- Marked as reviewed by jlahoda (Reviewer). PR Review: https://git.openjdk.org/jdk/pull/15638#pullrequestreview-1850754613 From hannesw at openjdk.org Tue Jan 30 16:17:18 2024 From: hannesw at openjdk.org (Hannes =?UTF-8?B?V2FsbG7DtmZlcg==?=) Date: Tue, 30 Jan 2024 16:17:18 GMT Subject: RFR: JDK-8164094: javadoc allows to create a @link to a non-existent method [v2] In-Reply-To: <8M-Q1_V6QTLNtS503174G4CFD87BNmavK8kPijRV3Nc=.9a957e2e-b9c4-4ffe-bd6c-2399fc96e5cf@github.com> References: <-xM8YSleEZ-CQY1FwsTvPsgYW3s8GmkOkGi-9r8icuI=.da06c781-54fe-463a-abd7-c714e4d3982f@github.com> <_pikP7s04dGw96fPV2zU1ONXSPGQoZo4SRfYNifChBM=.00cf8f90-bb98-4ca2-9dc0-1a77d76462b6@github.com> <81GrAewa5NKD4xg8oTdTzr3X_whVENpiaI-aUbUHMC8=.9c18fc4d-155d-4825-9d72-1fda0c0ff66c@github.com> <8M-Q1_V6QTLNtS503174G4CFD87BNmavK8kPijRV3Nc=.9a957e2e-b9c4-4ffe-bd6c-2399fc96e5cf@github.com> Message-ID: On Mon, 29 Jan 2024 22:11:25 GMT, Jonathan Gibbons wrote: > All that is out of scope for here, and can be handled in [JDK-8324320](https://bugs.openjdk.org/browse/JDK-8324320), so I have one last question before I add my approval (or Pavel can lower the `/reviewer` count): Does this change affect the published/latest JDK API documentation in any way? I'm guessing not, but we've been surprised before. It affects the published JDK API docs insofar as it exposed [3 cases of method references with wrong types](https://bugs.openjdk.org/browse/JDK-8321889). This has already been fixed back in December. ------------- PR Comment: https://git.openjdk.org/jdk/pull/17069#issuecomment-1917081762 From hannesw at openjdk.org Tue Jan 30 16:17:23 2024 From: hannesw at openjdk.org (Hannes =?UTF-8?B?V2FsbG7DtmZlcg==?=) Date: Tue, 30 Jan 2024 16:17:23 GMT Subject: RFR: JDK-8164094: javadoc allows to create a @link to a non-existent method [v2] In-Reply-To: References: <-xM8YSleEZ-CQY1FwsTvPsgYW3s8GmkOkGi-9r8icuI=.da06c781-54fe-463a-abd7-c714e4d3982f@github.com> Message-ID: On Tue, 12 Dec 2023 12:42:41 GMT, Hannes Walln?fer wrote: >> Please review a simple fix in `JavacTrees` to only look up member references in the enclosing type if the reference does not contain an explicit type name. For example, `@see #method()` in a a doc comment of class `Outer.Inner` should find method `Outer.method()`, but `@see Inner#method()` should not (regardless of comment location). > > Hannes Walln?fer 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 three additional commits since the last revision: > > - Merge branch 'master' into JDK-8164094 > - Additional test > - JDK-8164094: javadoc allows to create a @link to a non-existent method Just to make sure I generated JDK API docs with and without this fix and there was no diff in outputs. ------------- PR Comment: https://git.openjdk.org/jdk/pull/17069#issuecomment-1917188014 From jjg at openjdk.org Tue Jan 30 19:31:40 2024 From: jjg at openjdk.org (Jonathan Gibbons) Date: Tue, 30 Jan 2024 19:31:40 GMT Subject: RFR: JDK-8298405: Support Markdown in Documentation Comments [v7] In-Reply-To: References: <0pRMUgBnvCfb7DTm_pDnIlmuYdXH8URKFAIk5cT082Y=.f4c324b6-ef98-41b3-9b06-9cb82e03b08f@github.com> Message-ID: On Mon, 22 Jan 2024 15:35:41 GMT, Pavel Rappo wrote: >> Jonathan Gibbons has updated the pull request with a new target base due to a merge or a rebase. The pull request now contains eight commits: >> >> - Merge with upstream/master >> - Merge with upstream/master >> - Merge remote-tracking branch 'upstream/master' into 8298405.doclet-markdown-v3 >> - Address review comments >> - Fix whitespace >> - Improve handling of embedded inline taglets >> - Customize support for Markdown headings >> - JDK-8298405: Support Markdown in Documentation Comments > > src/jdk.compiler/share/classes/com/sun/tools/javac/parser/DocCommentParser.java line 271: > >> 269: // if (textStart == -1) { >> 270: // textStart = bp; >> 271: // } > > What's up with that? It was a temporary senior moment, attempting to trim the content of the comment -- but the leading whitespace is significant and should not be removed. The lines have been removed. > src/jdk.compiler/share/classes/com/sun/tools/javac/parser/DocCommentParser.java line 1165: > >> 1163: } >> 1164: >> 1165: > > Please delete this blank line. Done > src/jdk.compiler/share/classes/com/sun/tools/javac/parser/DocCommentParser.java line 1333: > >> 1331: lineKind = (ch == '\n' || ch == '\r') ? LineKind.BLANK >> 1332: : (indent <= 3) ? peekLineKind() >> 1333: : LineKind.OTHER; > > Nested ternary-s are hard to read. Nested if-s are bulky. Sigh. That was the neatest I could make it ;-) ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/16388#discussion_r1471829709 PR Review Comment: https://git.openjdk.org/jdk/pull/16388#discussion_r1471831762 PR Review Comment: https://git.openjdk.org/jdk/pull/16388#discussion_r1471830921 From darcy at openjdk.org Tue Jan 30 21:00:41 2024 From: darcy at openjdk.org (Joe Darcy) Date: Tue, 30 Jan 2024 21:00:41 GMT Subject: RFR: JDK-8164094: javadoc allows to create a @link to a non-existent method [v2] In-Reply-To: <_pikP7s04dGw96fPV2zU1ONXSPGQoZo4SRfYNifChBM=.00cf8f90-bb98-4ca2-9dc0-1a77d76462b6@github.com> References: <-xM8YSleEZ-CQY1FwsTvPsgYW3s8GmkOkGi-9r8icuI=.da06c781-54fe-463a-abd7-c714e4d3982f@github.com> <_pikP7s04dGw96fPV2zU1ONXSPGQoZo4SRfYNifChBM=.00cf8f90-bb98-4ca2-9dc0-1a77d76462b6@github.com> Message-ID: On Wed, 13 Dec 2023 10:44:43 GMT, Hannes Walln?fer wrote: > > Should this issue have a CSR for the behavioral change? > > My understanding of the issue is that the lookup of explicit-class member references in enclosing classes was an unintended consequence of doing the same for classless references from within nested classes. So I consider this a bug fix, not a feature change (even though it unfortunately changes javadoc to become stricter in what it accepts). > > Actually, the feature of extending member reference lookup to enclosing classes is not specified in the taglet spec, which only says this: > > > When the reference is to a member of the same class as that containing the documentation comment, all parts of the reference up to and including the # may be omitted, although the '#' may be retained for clarity. > > This could be extended to include enclosing classes, but this is existing behaviour, not changed by this issue. Looping back on this, independent of what the intended or specified behavior was before, if the behavior is changing now, even in agreed upon ways, the change should probably go through CSR review. ------------- PR Comment: https://git.openjdk.org/jdk/pull/17069#issuecomment-1917882512 From jjg at openjdk.org Tue Jan 30 21:01:39 2024 From: jjg at openjdk.org (Jonathan Gibbons) Date: Tue, 30 Jan 2024 21:01:39 GMT Subject: RFR: JDK-8298405: Support Markdown in Documentation Comments [v7] In-Reply-To: <_WLv7XFq2-900uOZFhRJ8rLQmjlFdTlHmC9wVfS6I-Y=.1ada9999-1a0e-4f88-aa67-5d4120585f35@github.com> References: <0pRMUgBnvCfb7DTm_pDnIlmuYdXH8URKFAIk5cT082Y=.f4c324b6-ef98-41b3-9b06-9cb82e03b08f@github.com> <_WLv7XFq2-900uOZFhRJ8rLQmjlFdTlHmC9wVfS6I-Y=.1ada9999-1a0e-4f88-aa67-5d4120585f35@github.com> Message-ID: On Tue, 23 Jan 2024 12:01:38 GMT, Pavel Rappo wrote: >> Jonathan Gibbons has updated the pull request with a new target base due to a merge or a rebase. The pull request now contains eight commits: >> >> - Merge with upstream/master >> - Merge with upstream/master >> - Merge remote-tracking branch 'upstream/master' into 8298405.doclet-markdown-v3 >> - Address review comments >> - Fix whitespace >> - Improve handling of embedded inline taglets >> - Customize support for Markdown headings >> - JDK-8298405: Support Markdown in Documentation Comments > > src/jdk.compiler/share/classes/com/sun/tools/javac/parser/DocCommentParser.java line 225: > >> 223: while (ch == ' ' && bp < buflen) { >> 224: nextChar(); >> 225: } > > Why do we specifically care about `\s` symbols here rather than about broader whitespace? Good catch and a tricky question. It's a conflict between typically skipping whitespace after a tag name (in traditional comments) and leading whitespace being significant in Markdown text. Resolved in a compromise by using `isHorizontalWhiteSpace(c)` and adding an explanatory comment. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/16388#discussion_r1471950685 From darcy at openjdk.org Tue Jan 30 21:15:36 2024 From: darcy at openjdk.org (Joe Darcy) Date: Tue, 30 Jan 2024 21:15:36 GMT Subject: RFR: 8303374: Implement JEP 455: Primitive Types in Patterns, instanceof, and switch (Preview) [v56] In-Reply-To: References: <4GCkSMggtYI8KnM-kELHez3Nd42WIrfd6jOF1bbK5PA=.12aec6f3-669b-4675-ad34-ffe28cb23459@github.com> Message-ID: On Mon, 29 Jan 2024 23:53:08 GMT, Aggelos Biboudis wrote: >> 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 incrementally with one additional commit since the last revision: > > Address review by Jan test/jdk/java/lang/runtime/ExactnessConversionsSupportTest.java line 46: > 44: * @test > 45: * @bug 8304487 > 46: * @summary Compiler Implementation for Primitive types in patterns, instanceof, and switch (Preview) While the bug synopsis isn't off-topic for the summary, the summary could be more informative, something like: "Verify boundary and special cases of exact conversion predicates", etc. test/jdk/java/lang/runtime/ExactnessConversionsSupportTest.java line 65: > 63: } > 64: > 65: public static void testByte() { If this test had the likelihood of needing to be updated, I would recommend some kind of refactoring so that the implicit loops ("for each of these boundary values in type T..") were explicit, but given that the test should not need to be updated often, I think the current approach is fine. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/15638#discussion_r1471963476 PR Review Comment: https://git.openjdk.org/jdk/pull/15638#discussion_r1471968497 From jjg at openjdk.org Tue Jan 30 21:20:37 2024 From: jjg at openjdk.org (Jonathan Gibbons) Date: Tue, 30 Jan 2024 21:20:37 GMT Subject: RFR: JDK-8298405: Support Markdown in Documentation Comments [v7] In-Reply-To: <0zUYUefrZalsT0jrEQtrvFotZ5JPLWuNxSromK26qM8=.2e1139ff-e3f1-4f74-87cf-ffdd684d6b50@github.com> References: <0pRMUgBnvCfb7DTm_pDnIlmuYdXH8URKFAIk5cT082Y=.f4c324b6-ef98-41b3-9b06-9cb82e03b08f@github.com> <_WLv7XFq2-900uOZFhRJ8rLQmjlFdTlHmC9wVfS6I-Y=.1ada9999-1a0e-4f88-aa67-5d4120585f35@github.com> <0zUYUefrZalsT0jrEQtrvFotZ5JPLWuNxSromK26qM8=.2e1139ff-e3f1-4f74-87cf-ffdd684d6b50@github.com> Message-ID: On Thu, 25 Jan 2024 12:41:02 GMT, Pavel Rappo wrote: >> src/jdk.compiler/share/classes/com/sun/tools/javac/parser/DocCommentParser.java line 1388: >> >>> 1386: * @see Thematic Break >>> 1387: */ >>> 1388: THEMATIC_BREAK(Pattern.compile("((\\+[ \t]*+){3,})|((-[ \t]*+){3,})|((_[ \t]*+){3,})")), >> >> Suggestion: >> >> /** >> * Thematic break: a line of * - _ interspersed with optional spaces and tabs >> * @see Thematic Break >> */ >> THEMATIC_BREAK(Pattern.compile("((\*[ \t]*+){3,})|((-[ \t]*+){3,})|((_[ \t]*+){3,})")), > > To add to my earlier [comment], DocCommentParser recognises THEMATIC_BREAK consisting of `-` as SETEXT_UNDERLINE. While it's inaccurate, it doesn't seem important, as DCP's goal is to recognise and avoid Markdown, not process it. > > [comment]: https://github.com/openjdk/jdk/pull/16388/files#r1462148038 Added lots more comment to the `LineKind` enum. For the record, I would rephrase your statement about DCP's goal as follows: _DCP's goal is to recognize block boundaries when skipping over literal text, such as a code span; the specific kind of boundary generally does not matter._ ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/16388#discussion_r1471973350 From jjg at openjdk.org Tue Jan 30 21:42:43 2024 From: jjg at openjdk.org (Jonathan Gibbons) Date: Tue, 30 Jan 2024 21:42:43 GMT Subject: RFR: JDK-8298405: Support Markdown in Documentation Comments [v7] In-Reply-To: <_WLv7XFq2-900uOZFhRJ8rLQmjlFdTlHmC9wVfS6I-Y=.1ada9999-1a0e-4f88-aa67-5d4120585f35@github.com> References: <0pRMUgBnvCfb7DTm_pDnIlmuYdXH8URKFAIk5cT082Y=.f4c324b6-ef98-41b3-9b06-9cb82e03b08f@github.com> <_WLv7XFq2-900uOZFhRJ8rLQmjlFdTlHmC9wVfS6I-Y=.1ada9999-1a0e-4f88-aa67-5d4120585f35@github.com> Message-ID: On Tue, 23 Jan 2024 12:50:45 GMT, Pavel Rappo wrote: >> Jonathan Gibbons has updated the pull request with a new target base due to a merge or a rebase. The pull request now contains eight commits: >> >> - Merge with upstream/master >> - Merge with upstream/master >> - Merge remote-tracking branch 'upstream/master' into 8298405.doclet-markdown-v3 >> - Address review comments >> - Fix whitespace >> - Improve handling of embedded inline taglets >> - Customize support for Markdown headings >> - JDK-8298405: Support Markdown in Documentation Comments > > src/jdk.compiler/share/classes/com/sun/tools/javac/parser/DocCommentParser.java line 1396: > >> 1394: * @see Code Fence >> 1395: */ >> 1396: CODE_FENCE(Pattern.compile("(`{3,}[^`]*+)|(~{3,}.*+)")), > > Why are this and the previous patterns possessive (`+`), while others aren't? Trying to avoid the runaway performance problem, such as described here: https://www.regular-expressions.info/catastrophic.html > src/jdk.compiler/share/classes/com/sun/tools/javac/parser/JavaTokenizer.java line 1065: > >> 1063: >> 1064: if (accept('/')) { // (Spec. 3.7) >> 1065: if (accept('/')) { // Markdown comment > > Here and elsewhere in this file: do we need to mention Markdown? The "M" word appears 10 times in this file. I'll work to convert them to an alternate nomenclature, such as "line comment". ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/16388#discussion_r1471991081 PR Review Comment: https://git.openjdk.org/jdk/pull/16388#discussion_r1471995407 From jjg at openjdk.org Tue Jan 30 22:09:10 2024 From: jjg at openjdk.org (Jonathan Gibbons) Date: Tue, 30 Jan 2024 22:09:10 GMT Subject: RFR: JDK-8298405: Support Markdown in Documentation Comments [v7] In-Reply-To: <_WLv7XFq2-900uOZFhRJ8rLQmjlFdTlHmC9wVfS6I-Y=.1ada9999-1a0e-4f88-aa67-5d4120585f35@github.com> References: <0pRMUgBnvCfb7DTm_pDnIlmuYdXH8URKFAIk5cT082Y=.f4c324b6-ef98-41b3-9b06-9cb82e03b08f@github.com> <_WLv7XFq2-900uOZFhRJ8rLQmjlFdTlHmC9wVfS6I-Y=.1ada9999-1a0e-4f88-aa67-5d4120585f35@github.com> Message-ID: On Tue, 23 Jan 2024 15:07:15 GMT, Pavel Rappo wrote: >> Jonathan Gibbons has updated the pull request with a new target base due to a merge or a rebase. The pull request now contains eight commits: >> >> - Merge with upstream/master >> - Merge with upstream/master >> - Merge remote-tracking branch 'upstream/master' into 8298405.doclet-markdown-v3 >> - Address review comments >> - Fix whitespace >> - Improve handling of embedded inline taglets >> - Customize support for Markdown headings >> - JDK-8298405: Support Markdown in Documentation Comments > > src/jdk.compiler/share/classes/com/sun/tools/javac/parser/JavaTokenizer.java line 1553: > >> 1551: >> 1552: /** >> 1553: * Determine how much indent to remove from markdown comment. > > Suggestion: > > * Determine how much indent to remove from Markdown comment. fixed > src/jdk.compiler/share/classes/com/sun/tools/javac/parser/JavaTokenizer.java line 1585: > >> 1583: */ >> 1584: UnicodeReader trimMarkdownComment(UnicodeReader line, int indent) { >> 1585: int pos = line.position(); > > Unused. Yes, and the method has no side effects. Removed. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/16388#discussion_r1472018320 PR Review Comment: https://git.openjdk.org/jdk/pull/16388#discussion_r1472020269 From jjg at openjdk.org Tue Jan 30 22:15:34 2024 From: jjg at openjdk.org (Jonathan Gibbons) Date: Tue, 30 Jan 2024 22:15:34 GMT Subject: RFR: JDK-8298405: Support Markdown in Documentation Comments [v7] In-Reply-To: References: <0pRMUgBnvCfb7DTm_pDnIlmuYdXH8URKFAIk5cT082Y=.f4c324b6-ef98-41b3-9b06-9cb82e03b08f@github.com> Message-ID: <-lRAdoRxdP6KQp7EeUDMEMnOTe_EbNRPZAiSQnfvRes=.e8c57191-3f8c-406f-a609-baba15bd233e@github.com> On Mon, 22 Jan 2024 16:57:16 GMT, Pavel Rappo wrote: >> Jonathan Gibbons has updated the pull request with a new target base due to a merge or a rebase. The pull request now contains eight commits: >> >> - Merge with upstream/master >> - Merge with upstream/master >> - Merge remote-tracking branch 'upstream/master' into 8298405.doclet-markdown-v3 >> - Address review comments >> - Fix whitespace >> - Improve handling of embedded inline taglets >> - Customize support for Markdown headings >> - JDK-8298405: Support Markdown in Documentation Comments > > src/jdk.compiler/share/classes/com/sun/tools/javac/parser/DocCommentParser.java line 1377: > >> 1375: * @see ATX Headings >> 1376: */ >> 1377: ATX_HEADER(Pattern.compile("#{1,6}( .*|$)")), > > Actually, I wonder how accurate those regexes should match spec. Given the definition [^*] of an ATX header and the fact that we always match the complete (not find inside) a line, which by definition should not have line terminators, shouldn't it be like this? > > #{1,6}([ \t]+.*)? > > [^*]: The opening sequence of # characters must be followed by spaces or tabs, or by the end of line. The spec says: > The opening sequence of # characters must be followed by spaces or tabs, or by the end of line. so we're both slightly wrong. :-) I will fix to `"#{1,6}([ \t].*|$)"))` ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/16388#discussion_r1472036765 From jjg at openjdk.org Tue Jan 30 22:20:32 2024 From: jjg at openjdk.org (Jonathan Gibbons) Date: Tue, 30 Jan 2024 22:20:32 GMT Subject: RFR: JDK-8298405: Support Markdown in Documentation Comments [v7] In-Reply-To: <_WLv7XFq2-900uOZFhRJ8rLQmjlFdTlHmC9wVfS6I-Y=.1ada9999-1a0e-4f88-aa67-5d4120585f35@github.com> References: <0pRMUgBnvCfb7DTm_pDnIlmuYdXH8URKFAIk5cT082Y=.f4c324b6-ef98-41b3-9b06-9cb82e03b08f@github.com> <_WLv7XFq2-900uOZFhRJ8rLQmjlFdTlHmC9wVfS6I-Y=.1ada9999-1a0e-4f88-aa67-5d4120585f35@github.com> Message-ID: On Tue, 23 Jan 2024 15:17:14 GMT, Pavel Rappo wrote: >> Jonathan Gibbons has updated the pull request with a new target base due to a merge or a rebase. The pull request now contains eight commits: >> >> - Merge with upstream/master >> - Merge with upstream/master >> - Merge remote-tracking branch 'upstream/master' into 8298405.doclet-markdown-v3 >> - Address review comments >> - Fix whitespace >> - Improve handling of embedded inline taglets >> - Customize support for Markdown headings >> - JDK-8298405: Support Markdown in Documentation Comments > > src/jdk.compiler/share/classes/com/sun/tools/javac/parser/ParserFactory.java line 30: > >> 28: import java.util.Locale; >> 29: >> 30: import com.sun.source.util.DocTrees; > > Unused. removed > src/jdk.compiler/share/classes/com/sun/tools/javac/tree/DocPretty.java line 35: > >> 33: import com.sun.source.doctree.*; >> 34: import com.sun.source.doctree.AttributeTree.ValueKind; >> 35: import com.sun.source.util.DocTreeScanner; > > Unused. removed ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/16388#discussion_r1472042122 PR Review Comment: https://git.openjdk.org/jdk/pull/16388#discussion_r1472042782 From jjg at openjdk.org Tue Jan 30 23:05:01 2024 From: jjg at openjdk.org (Jonathan Gibbons) Date: Tue, 30 Jan 2024 23:05:01 GMT Subject: RFR: JDK-8298405: Support Markdown in Documentation Comments [v7] In-Reply-To: References: <0pRMUgBnvCfb7DTm_pDnIlmuYdXH8URKFAIk5cT082Y=.f4c324b6-ef98-41b3-9b06-9cb82e03b08f@github.com> Message-ID: On Wed, 24 Jan 2024 12:17:19 GMT, Pavel Rappo wrote: >> Jonathan Gibbons has updated the pull request with a new target base due to a merge or a rebase. The pull request now contains eight commits: >> >> - Merge with upstream/master >> - Merge with upstream/master >> - Merge remote-tracking branch 'upstream/master' into 8298405.doclet-markdown-v3 >> - Address review comments >> - Fix whitespace >> - Improve handling of embedded inline taglets >> - Customize support for Markdown headings >> - JDK-8298405: Support Markdown in Documentation Comments > > src/jdk.compiler/share/classes/com/sun/tools/javac/tree/DocTreeMaker.java line 238: > >> 236: && postamble.isEmpty() >> 237: && fullBody.stream().anyMatch(t -> t.getKind() == Kind.MARKDOWN) >> 238: ? CommentStyle.JAVADOC_LINE : CommentStyle.JAVADOC_BLOCK; > > While clever, it seems to be prone to false positive `JAVADOC_LINE`. Also, it is inconsistent with `null` and `Position.NOPOS` returned from the `getText` and `getSourcePos(int)` methods respectively. I'm not worried about false positive `JAVADOC_LINE` than maybe false _negative_ `JAVADOC_LINE`. Generally, the underlying issue here is how to handle weird combinations of `DocTrees` constructed by a user of the public API. For example, should we check, and reject, a `fullBody` containing `MARKDOWN` nodes and non-empty `preamble` or `postamble`, since that combination will never come from `DocCommentParser`. I'm not worried about comparison with `getText` and `getSourcePos`, since there really is no other value for the source text or source position that we can return. But we can infer a best guess for the style. Arguably, we should check the `tags` as well. ------ I dug deeper. We do create synthetic trees in the standard doclet, such as for the descriptions of mandated methods (like `values` and `valueOf` for any enum class. Those synthetic trees do utilize this code path, although the `getStyle` method is not currently invoked. (Verified by changing code to throw `UnsupportedOperationException` and run all the tests.) It's also true those synthetic trees do not leverage any Markdown support at this time. I prefer to leave the code as-is at this time. > src/jdk.compiler/share/classes/com/sun/tools/javac/tree/DocTreeMaker.java line 704: > >> 702: } >> 703: >> 704: // If the break is well within the span of the string i.e. not > > Oh irony! Sentence segmentation in javadoc has some problems with abbreviations like that. This was fixed 10/26/23. Both forms of the sentence breaker are supposed to get this correct, but yes, chuckle, irony. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/16388#discussion_r1472082408 PR Review Comment: https://git.openjdk.org/jdk/pull/16388#discussion_r1472089239 From jjg at openjdk.org Tue Jan 30 23:11:05 2024 From: jjg at openjdk.org (Jonathan Gibbons) Date: Tue, 30 Jan 2024 23:11:05 GMT Subject: RFR: JDK-8298405: Support Markdown in Documentation Comments [v10] In-Reply-To: References: <0pRMUgBnvCfb7DTm_pDnIlmuYdXH8URKFAIk5cT082Y=.f4c324b6-ef98-41b3-9b06-9cb82e03b08f@github.com> Message-ID: On Wed, 24 Jan 2024 16:24:25 GMT, Pavel Rappo wrote: >> Jonathan Gibbons has updated the pull request incrementally with two additional commits since the last revision: >> >> - fix @since tags >> - fix copyright year > > src/jdk.compiler/share/classes/com/sun/tools/javac/tree/DocTreeMaker.java line 572: > >> 570: } >> 571: >> 572: case TEXT -> { > > I haven't looked at `SentenceBreaker` in detail, but one thing that bothers me is that it sees a comment before that comment has been transformed. This means that `///` comments might not "feel" like Markdown to authors. First up: I do not understand your second sentence: _This means that /// comments might not "feel" like Markdown to authors._ Please rephrase or clarify that. That aside, there's a big case of chickens and eggs here. The API assumes that the first sentence is distinct from the rest of the description, so we cannot transform it at that early stage. But generally, the first sentence is supposed to be reasonably simple text, and for cases where it is not, you can use the `summary` tag to circumvent any use of the sentence breaker. Bottom line, I do not see any cause for concern at this time. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/16388#discussion_r1472097755 From jjg at openjdk.org Tue Jan 30 23:18:15 2024 From: jjg at openjdk.org (Jonathan Gibbons) Date: Tue, 30 Jan 2024 23:18:15 GMT Subject: RFR: JDK-8298405: Support Markdown in Documentation Comments [v7] In-Reply-To: References: <0pRMUgBnvCfb7DTm_pDnIlmuYdXH8URKFAIk5cT082Y=.f4c324b6-ef98-41b3-9b06-9cb82e03b08f@github.com> Message-ID: On Wed, 24 Jan 2024 16:30:50 GMT, Pavel Rappo wrote: >> Jonathan Gibbons has updated the pull request with a new target base due to a merge or a rebase. The pull request now contains eight commits: >> >> - Merge with upstream/master >> - Merge with upstream/master >> - Merge remote-tracking branch 'upstream/master' into 8298405.doclet-markdown-v3 >> - Address review comments >> - Fix whitespace >> - Improve handling of embedded inline taglets >> - Customize support for Markdown headings >> - JDK-8298405: Support Markdown in Documentation Comments > > src/jdk.compiler/share/classes/com/sun/tools/javac/tree/DocTreeMaker.java line 790: > >> 788: >> 789: // end of paragraph is newline, followed by a blank line or the beginning of the next block >> 790: private static final Pattern endPara = Pattern.compile("\n(([ \t]*\n)|( {0,3}[-+*#=]))"); > > So DocTreeMaker now also knows about Markdown. I wonder if we can avoid that. Also, I assume you mean this (`+` is not a part of "thematic break"): > Suggestion: > > private static final Pattern endPara = Pattern.compile("\n(([ \t]*\n)|( {0,3}[-_*#=]))"); The code is doing its best to model the non-Markdown behavior, which is to detect paragraph breaks, which terminate the first sentence in the absence of any period. `+` is in the pattern as a list marker; I added `_` for thematic break, and added more comments. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/16388#discussion_r1472103907 From jjg at openjdk.org Tue Jan 30 23:39:51 2024 From: jjg at openjdk.org (Jonathan Gibbons) Date: Tue, 30 Jan 2024 23:39:51 GMT Subject: RFR: JDK-8298405: Support Markdown in Documentation Comments [v7] In-Reply-To: References: <0pRMUgBnvCfb7DTm_pDnIlmuYdXH8URKFAIk5cT082Y=.f4c324b6-ef98-41b3-9b06-9cb82e03b08f@github.com> Message-ID: On Wed, 24 Jan 2024 19:43:51 GMT, Pavel Rappo wrote: >> Jonathan Gibbons has updated the pull request with a new target base due to a merge or a rebase. The pull request now contains eight commits: >> >> - Merge with upstream/master >> - Merge with upstream/master >> - Merge remote-tracking branch 'upstream/master' into 8298405.doclet-markdown-v3 >> - Address review comments >> - Fix whitespace >> - Improve handling of embedded inline taglets >> - Customize support for Markdown headings >> - JDK-8298405: Support Markdown in Documentation Comments > > src/jdk.internal.md/share/classes/jdk/internal/markdown/MarkdownTransformer.java line 221: > >> 219: } >> 220: String code = t.getContent(); >> 221: // handle the (unlikely) case of FFFC characters existing in the code > > For consistency with the rest of the file: > Suggestion: > > // handle the (unlikely) case of U+FFFC characters existing in the code Fixed > src/jdk.internal.md/share/classes/jdk/internal/markdown/MarkdownTransformer.java line 230: > >> 228: start = pos + 1; >> 229: } >> 230: sourceBuilder.append(code.substring(start)); > > If I understood this correctly, it could be achieved simpler: > Suggestion: > > replacements.add(PLACEHOLDER); > start = pos + 1; > } > sourceBuilder.append(code); clever! > src/jdk.internal.md/share/classes/jdk/internal/markdown/MarkdownTransformer.java line 353: > >> 351: return (equal(desc2, tree.description)) >> 352: ? tree >> 353: : m.at(tree.pos).newReturnTree(tree.inline, desc2).setEndPos(tree.getEndPos()); > > Don't we need to set end position here only if the tag is in its inline variant? It has an `endPos` field; we might as well set it. > src/jdk.internal.md/share/classes/jdk/internal/markdown/MarkdownTransformer.java line 559: > >> 557: private boolean isReference(String s) { >> 558: try { >> 559: var ref = refParser.parse(s, ReferenceParser.Mode.MEMBER_OPTIONAL); > > Suggestion: > > refParser.parse(s, ReferenceParser.Mode.MEMBER_OPTIONAL); ok ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/16388#discussion_r1472107834 PR Review Comment: https://git.openjdk.org/jdk/pull/16388#discussion_r1472111878 PR Review Comment: https://git.openjdk.org/jdk/pull/16388#discussion_r1472106632 PR Review Comment: https://git.openjdk.org/jdk/pull/16388#discussion_r1472112635 From jjg at openjdk.org Tue Jan 30 23:56:14 2024 From: jjg at openjdk.org (Jonathan Gibbons) Date: Tue, 30 Jan 2024 23:56:14 GMT Subject: RFR: JDK-8298405: Support Markdown in Documentation Comments [v7] In-Reply-To: References: <0pRMUgBnvCfb7DTm_pDnIlmuYdXH8URKFAIk5cT082Y=.f4c324b6-ef98-41b3-9b06-9cb82e03b08f@github.com> Message-ID: <82KgOfWLlL77CZkJUnSaiWxaSuu4C1uLkzr6BHnCUd4=.aeeb8842-7c6c-4db3-bf70-690e0008f74c@github.com> On Wed, 24 Jan 2024 22:38:58 GMT, Pavel Rappo wrote: >> Jonathan Gibbons has updated the pull request with a new target base due to a merge or a rebase. The pull request now contains eight commits: >> >> - Merge with upstream/master >> - Merge with upstream/master >> - Merge remote-tracking branch 'upstream/master' into 8298405.doclet-markdown-v3 >> - Address review comments >> - Fix whitespace >> - Improve handling of embedded inline taglets >> - Customize support for Markdown headings >> - JDK-8298405: Support Markdown in Documentation Comments > > src/jdk.internal.md/share/classes/jdk/internal/markdown/MarkdownTransformer.java line 487: > >> 485: } >> 486: >> 487: private static final String AUTOREF_PREFIX = "code:"; > > I wish the prefix were such that it could not be forged: for example, automatically assigned, unique within a document comment. I guess I don't see this as being as big a deal as you seem to think it is. What is it that you are so concerned about? I also think it is a potential feature to document and use reference links with `code:` URLs, using the reference link syntax to avoid having long method signatures in narrative text. For example, One of the methods on [List] has [lots of args][List.of10]. [List.of10]code:List.of(E,E,E,E,E,E,E,E,E,E) > src/jdk.internal.md/share/classes/jdk/internal/markdown/MarkdownTransformer.java line 763: > >> 761: * >> 762: * @param link the link node >> 763: */ > > Suggestion: > > /** > * Visits a {@code Link} commonmark node. > * > * If the destination for the link begins with {@code code:} > * convert it to {@code {@link ...}} or {@code {@linkplain ...}} doc tree node. > * {@code {@link ...}} will be used if the content (label) for > * the link is the same as the reference found after the {@code code:}; > * otherwise, {@code {@linkplain ...}} will be used. > * > * The label will be left blank for {@code {@link ...}} nodes, > * implying that a default label should be used, based on the > * program element that was referenced. > * > * @param link the link node > */ fixed > src/jdk.internal.md/share/classes/jdk/internal/markdown/MarkdownTransformer.java line 771: > >> 769: copyTo(getStartPos(link)); >> 770: // push temporary value for {@code trees} while handling the content of the node >> 771: var saveTrees = trees; > > "saveTrees": I see what you did there :-) ?? Not sure I understand this comment. > src/jdk.internal.md/share/classes/jdk/internal/markdown/MarkdownTransformer.java line 778: > >> 776: copyTo(getEndPos(link.getLastChild())); >> 777: >> 778: // determine whether to use {@link... } or {@linkplain ...} > > Nit: > Suggestion: > > // determine whether to use {@link ... } or {@linkplain ...} fixed > src/jdk.internal.md/share/classes/jdk/internal/markdown/MarkdownTransformer.java line 840: > >> 838: >> 839: /** >> 840: * Process a node and any children. > > Suggestion: > > * Processes a node and any children. fixed > src/jdk.internal.md/share/classes/jdk/internal/markdown/MarkdownTransformer.java line 882: > >> 880: private int getStartPos(Node node) { >> 881: var spans = node.getSourceSpans(); >> 882: var firstSpan = spans.get(0); > > Suggestion: > > var firstSpan = spans.getFirst(); done > src/jdk.internal.md/share/classes/jdk/internal/markdown/MarkdownTransformer.java line 894: > >> 892: private int getEndPos(Node node) { >> 893: var spans = node.getSourceSpans(); >> 894: var lastSpan = spans.get(spans.size() - 1); > > Suggestion: > > var lastSpan = spans.getLast(); Done > src/jdk.internal.md/share/classes/jdk/internal/markdown/MarkdownTransformer.java line 950: > >> 948: } >> 949: >> 950: > > Suggestion: fixed ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/16388#discussion_r1472122002 PR Review Comment: https://git.openjdk.org/jdk/pull/16388#discussion_r1472129024 PR Review Comment: https://git.openjdk.org/jdk/pull/16388#discussion_r1472125185 PR Review Comment: https://git.openjdk.org/jdk/pull/16388#discussion_r1472129294 PR Review Comment: https://git.openjdk.org/jdk/pull/16388#discussion_r1472129971 PR Review Comment: https://git.openjdk.org/jdk/pull/16388#discussion_r1472123360 PR Review Comment: https://git.openjdk.org/jdk/pull/16388#discussion_r1472124337 PR Review Comment: https://git.openjdk.org/jdk/pull/16388#discussion_r1472130370 From jjg at openjdk.org Wed Jan 31 00:06:37 2024 From: jjg at openjdk.org (Jonathan Gibbons) Date: Wed, 31 Jan 2024 00:06:37 GMT Subject: RFR: JDK-8298405: Support Markdown in Documentation Comments [v11] In-Reply-To: References: Message-ID: > Please review a patch to add support for Markdown syntax in documentation comments, as described in the associated JEP. > > Notable features: > > * support for `///` documentation comments in `JavaTokenizer` > * new module `jdk.internal.md` -- a private copy of the `commonmark-java` library > * updates to `DocCommentParser` to treat `///` comments as Markdown > * updates to the standard doclet to render Markdown comments in HTML Jonathan Gibbons has updated the pull request incrementally with one additional commit since the last revision: address review feedback ------------- Changes: - all: https://git.openjdk.org/jdk/pull/16388/files - new: https://git.openjdk.org/jdk/pull/16388/files/5e3f03c8..50c3a40b Webrevs: - full: https://webrevs.openjdk.org/?repo=jdk&pr=16388&range=10 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=16388&range=09-10 Stats: 101 lines in 8 files changed: 47 ins; 16 del; 38 mod Patch: https://git.openjdk.org/jdk/pull/16388.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/16388/head:pull/16388 PR: https://git.openjdk.org/jdk/pull/16388 From abimpoudis at openjdk.org Wed Jan 31 10:03:23 2024 From: abimpoudis at openjdk.org (Aggelos Biboudis) Date: Wed, 31 Jan 2024 10:03:23 GMT Subject: RFR: 8303374: Implement JEP 455: Primitive Types in Patterns, instanceof, and switch (Preview) [v57] 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 78 commits: - Merge branch 'master' into primitive-patterns - Update summary in ExactnessConversionsSupportTest - Address review by Jan - Remove redundant null check and introduce a const boolean for unconditionally exact pairs - Small fix in Javadoc - Tidy up Javadoc of Lower.visitTypeTest - Tidy up Javadoc of IllegalArgumentException in typeSwitch - Improve readability in SwitchBootstraps - Update year - Cleanup redundant clone - ... and 68 more: https://git.openjdk.org/jdk/compare/ec56c72b...f68748b1 ------------- Changes: https://git.openjdk.org/jdk/pull/15638/files Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=15638&range=56 Stats: 3818 lines in 45 files changed: 3385 ins; 212 del; 221 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 hannesw at openjdk.org Wed Jan 31 12:10:02 2024 From: hannesw at openjdk.org (Hannes =?UTF-8?B?V2FsbG7DtmZlcg==?=) Date: Wed, 31 Jan 2024 12:10:02 GMT Subject: RFR: JDK-8164094: javadoc allows to create a @link to a non-existent method [v2] In-Reply-To: References: <-xM8YSleEZ-CQY1FwsTvPsgYW3s8GmkOkGi-9r8icuI=.da06c781-54fe-463a-abd7-c714e4d3982f@github.com> <_pikP7s04dGw96fPV2zU1ONXSPGQoZo4SRfYNifChBM=.00cf8f90-bb98-4ca2-9dc0-1a77d76462b6@github.com> Message-ID: <_RHFv82Vn2S2MtARHaN_19u82LDY3nbng0ZkoaM2k8s=.6bc7b0f8-9ae0-4981-b50b-827687b20599@github.com> On Tue, 30 Jan 2024 20:58:32 GMT, Joe Darcy wrote: > Looping back on this, independent of what the intended or specified behavior was before, if the behavior is changing now, even in agreed upon ways, the change should probably go through CSR review. Ok, I've written a CSR. ------------- PR Comment: https://git.openjdk.org/jdk/pull/17069#issuecomment-1918979643 From abimpoudis at openjdk.org Wed Jan 31 14:21:14 2024 From: abimpoudis at openjdk.org (Aggelos Biboudis) Date: Wed, 31 Jan 2024 14:21:14 GMT Subject: Integrated: 8303374: Implement JEP 455: Primitive Types in Patterns, instanceof, and switch (Preview) In-Reply-To: <4GCkSMggtYI8KnM-kELHez3Nd42WIrfd6jOF1bbK5PA=.12aec6f3-669b-4675-ad34-ffe28cb23459@github.com> References: <4GCkSMggtYI8KnM-kELHez3Nd42WIrfd6jOF1bbK5PA=.12aec6f3-669b-4675-ad34-ffe28cb23459@github.com> Message-ID: <7MBpFjawIZA1YtjJ8_wP_6UeqG7n7wXF6N1yehtb150=.c8531d10-e969-4cac-bd95-d4e8748bfc49@github.com> On Fri, 8 Sep 2023 14:17:29 GMT, Aggelos Biboudis wrote: > This is the proposed patch for Primitive types in patterns, instanceof, and switch (Preview). > > Draft spec here: https://cr.openjdk.org/~abimpoudis/instanceof/latest/ This pull request has now been integrated. Changeset: 1733d2ea Author: Aggelos Biboudis URL: https://git.openjdk.org/jdk/commit/1733d2ea244756238c302d802511eb1557cd46ac Stats: 3818 lines in 45 files changed: 3385 ins; 212 del; 221 mod 8303374: Implement JEP 455: Primitive Types in Patterns, instanceof, and switch (Preview) Co-authored-by: Jan Lahoda Co-authored-by: Maurizio Cimadamore Co-authored-by: Gavin Bierman Co-authored-by: Brian Goetz Co-authored-by: Raffaello Giulietti Co-authored-by: Aggelos Biboudis Reviewed-by: vromero, jlahoda ------------- PR: https://git.openjdk.org/jdk/pull/15638 From jjg at openjdk.org Wed Jan 31 21:14:38 2024 From: jjg at openjdk.org (Jonathan Gibbons) Date: Wed, 31 Jan 2024 21:14:38 GMT Subject: RFR: JDK-8298405: Support Markdown in Documentation Comments [v12] In-Reply-To: References: Message-ID: > Please review a patch to add support for Markdown syntax in documentation comments, as described in the associated JEP. > > Notable features: > > * support for `///` documentation comments in `JavaTokenizer` > * new module `jdk.internal.md` -- a private copy of the `commonmark-java` library > * updates to `DocCommentParser` to treat `///` comments as Markdown > * updates to the standard doclet to render Markdown comments in HTML Jonathan Gibbons has updated the pull request with a new target base due to a merge or a rebase. The pull request now contains 15 commits: - refine the Comment used for synthetic doc comments - Merge remote-tracking branch 'upstream/master' into 8298405.doclet-markdown-v3 - address review feedback - fix @since tags - fix copyright year - Merge remote-tracking branch 'upstream/master' into 8298405.doclet-markdown-v3 - Merge remote-tracking branch 'upstream/master' into 8298405.doclet-markdown-v3 - Merge with upstream/master - Merge with upstream/master - Merge remote-tracking branch 'upstream/master' into 8298405.doclet-markdown-v3 - ... and 5 more: https://git.openjdk.org/jdk/compare/2cd1ba6a...0da7ba5c ------------- Changes: https://git.openjdk.org/jdk/pull/16388/files Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=16388&range=11 Stats: 21376 lines in 191 files changed: 20712 ins; 271 del; 393 mod Patch: https://git.openjdk.org/jdk/pull/16388.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/16388/head:pull/16388 PR: https://git.openjdk.org/jdk/pull/16388 From jjg at openjdk.org Wed Jan 31 21:18:09 2024 From: jjg at openjdk.org (Jonathan Gibbons) Date: Wed, 31 Jan 2024 21:18:09 GMT Subject: RFR: JDK-8298405: Support Markdown in Documentation Comments [v7] In-Reply-To: References: <0pRMUgBnvCfb7DTm_pDnIlmuYdXH8URKFAIk5cT082Y=.f4c324b6-ef98-41b3-9b06-9cb82e03b08f@github.com> Message-ID: On Tue, 30 Jan 2024 22:55:27 GMT, Jonathan Gibbons wrote: >> src/jdk.compiler/share/classes/com/sun/tools/javac/tree/DocTreeMaker.java line 238: >> >>> 236: && postamble.isEmpty() >>> 237: && fullBody.stream().anyMatch(t -> t.getKind() == Kind.MARKDOWN) >>> 238: ? CommentStyle.JAVADOC_LINE : CommentStyle.JAVADOC_BLOCK; >> >> While clever, it seems to be prone to false positive `JAVADOC_LINE`. Also, it is inconsistent with `null` and `Position.NOPOS` returned from the `getText` and `getSourcePos(int)` methods respectively. > > I'm not worried about false positive `JAVADOC_LINE` than maybe false _negative_ `JAVADOC_LINE`. Generally, the underlying issue here is how to handle weird combinations of `DocTrees` constructed by a user of the public API. For example, should we check, and reject, a `fullBody` containing `MARKDOWN` nodes and non-empty `preamble` or `postamble`, since that combination will never come from `DocCommentParser`. > > I'm not worried about comparison with `getText` and `getSourcePos`, since there really is no other value for the source text or source position that we can return. But we can infer a best guess for the style. > > Arguably, we should check the `tags` as well. > > ------ > > I dug deeper. > > We do create synthetic trees in the standard doclet, such as for the descriptions of mandated methods (like `values` and `valueOf` for any enum class. Those synthetic trees do utilize this code path, although the `getStyle` method is not currently invoked. (Verified by changing code to throw `UnsupportedOperationException` and run all the tests.) It's also true those synthetic trees do not leverage any Markdown support at this time. > > I prefer to leave the code as-is at this time. I revisited this, and rewrote the code and added more comments for now and for later. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/16388#discussion_r1473474540 From jjg at openjdk.org Wed Jan 31 22:06:26 2024 From: jjg at openjdk.org (Jonathan Gibbons) Date: Wed, 31 Jan 2024 22:06:26 GMT Subject: RFR: JDK-8298405: Support Markdown in Documentation Comments [v13] In-Reply-To: References: Message-ID: > Please review a patch to add support for Markdown syntax in documentation comments, as described in the associated JEP. > > Notable features: > > * support for `///` documentation comments in `JavaTokenizer` > * new module `jdk.internal.md` -- a private copy of the `commonmark-java` library > * updates to `DocCommentParser` to treat `///` comments as Markdown > * updates to the standard doclet to render Markdown comments in HTML Jonathan Gibbons has updated the pull request incrementally with one additional commit since the last revision: change AUTOREF_PREFIX from a static string to a dynamically generated autorefScheme ------------- Changes: - all: https://git.openjdk.org/jdk/pull/16388/files - new: https://git.openjdk.org/jdk/pull/16388/files/0da7ba5c..71ce4b16 Webrevs: - full: https://webrevs.openjdk.org/?repo=jdk&pr=16388&range=12 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=16388&range=11-12 Stats: 24 lines in 1 file changed: 11 ins; 3 del; 10 mod Patch: https://git.openjdk.org/jdk/pull/16388.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/16388/head:pull/16388 PR: https://git.openjdk.org/jdk/pull/16388 From jjg at openjdk.org Wed Jan 31 22:13:11 2024 From: jjg at openjdk.org (Jonathan Gibbons) Date: Wed, 31 Jan 2024 22:13:11 GMT Subject: RFR: JDK-8298405: Support Markdown in Documentation Comments [v7] In-Reply-To: References: <0pRMUgBnvCfb7DTm_pDnIlmuYdXH8URKFAIk5cT082Y=.f4c324b6-ef98-41b3-9b06-9cb82e03b08f@github.com> Message-ID: On Wed, 24 Jan 2024 22:35:31 GMT, Pavel Rappo wrote: >> Jonathan Gibbons has updated the pull request with a new target base due to a merge or a rebase. The pull request now contains eight commits: >> >> - Merge with upstream/master >> - Merge with upstream/master >> - Merge remote-tracking branch 'upstream/master' into 8298405.doclet-markdown-v3 >> - Address review comments >> - Fix whitespace >> - Improve handling of embedded inline taglets >> - Customize support for Markdown headings >> - JDK-8298405: Support Markdown in Documentation Comments > > src/jdk.internal.md/share/classes/jdk/internal/markdown/MarkdownTransformer.java line 543: > >> 541: @Override >> 542: public LinkReferenceDefinition getLinkReferenceDefinition(String label) { >> 543: var l = label.replace("\\[\\]", "[]"); > > That `String.replace` looks suspicious. FWIW, when I removed that `replace`, no tests failed. My recollection is that you have to escape square brackets in a reference label. I will investigate, and if necessary, add a test case. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/16388#discussion_r1473528775 From jjg at openjdk.org Wed Jan 31 22:18:09 2024 From: jjg at openjdk.org (Jonathan Gibbons) Date: Wed, 31 Jan 2024 22:18:09 GMT Subject: RFR: JDK-8298405: Support Markdown in Documentation Comments [v7] In-Reply-To: <82KgOfWLlL77CZkJUnSaiWxaSuu4C1uLkzr6BHnCUd4=.aeeb8842-7c6c-4db3-bf70-690e0008f74c@github.com> References: <0pRMUgBnvCfb7DTm_pDnIlmuYdXH8URKFAIk5cT082Y=.f4c324b6-ef98-41b3-9b06-9cb82e03b08f@github.com> <82KgOfWLlL77CZkJUnSaiWxaSuu4C1uLkzr6BHnCUd4=.aeeb8842-7c6c-4db3-bf70-690e0008f74c@github.com> Message-ID: On Tue, 30 Jan 2024 23:42:40 GMT, Jonathan Gibbons wrote: >> src/jdk.internal.md/share/classes/jdk/internal/markdown/MarkdownTransformer.java line 487: >> >>> 485: } >>> 486: >>> 487: private static final String AUTOREF_PREFIX = "code:"; >> >> I wish the prefix were such that it could not be forged: for example, automatically assigned, unique within a document comment. > > I guess I don't see this as being as big a deal as you seem to think it is. What is it that you are so concerned about? > > I also think it is a potential feature to document and use reference links with `code:` URLs, using the reference link syntax to avoid having long method signatures in narrative text. > > For example, > > One of the methods on [List] has [lots of args][List.of10]. > > [List.of10]code:List.of(E,E,E,E,E,E,E,E,E,E) I've changed the prefix to be dynamically generated. It's now called `autorefScheme` and is passed around as needed. It contains a hex hashcode, so is reasonably unguessable. I'm still sort-of sad to lose the ability to use `code:` URLs directly, so I've left a comment in the code hinting that that is a possibility. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/16388#discussion_r1473532970 From jjg at openjdk.org Wed Jan 31 23:13:07 2024 From: jjg at openjdk.org (Jonathan Gibbons) Date: Wed, 31 Jan 2024 23:13:07 GMT Subject: RFR: JDK-8298405: Support Markdown in Documentation Comments [v7] In-Reply-To: References: <0pRMUgBnvCfb7DTm_pDnIlmuYdXH8URKFAIk5cT082Y=.f4c324b6-ef98-41b3-9b06-9cb82e03b08f@github.com> Message-ID: On Wed, 31 Jan 2024 22:10:03 GMT, Jonathan Gibbons wrote: >> src/jdk.internal.md/share/classes/jdk/internal/markdown/MarkdownTransformer.java line 543: >> >>> 541: @Override >>> 542: public LinkReferenceDefinition getLinkReferenceDefinition(String label) { >>> 543: var l = label.replace("\\[\\]", "[]"); >> >> That `String.replace` looks suspicious. FWIW, when I removed that `replace`, no tests failed. > > My recollection is that you have to escape square brackets in a reference label. I will investigate, and if necessary, add a test case. Yes, you need to escape `[` and `]` within the label of any Markdown reference link, by preceding each with backslash. (Remember, the label is the string used to find the URL for the link; not the displayed text of the link). That's a CommonMark feature independent of this work. While we could change that `replace` call into two separate ones, in reference signatures they always appear together as a pair, and can be replaced together. We need to remove the escape characters in the generated URL so that the signature is a standard signature with unescaped `[]` For fun/demo, try the following: /// First sentence. /// * Link 0 to [java.lang.Object] /// * Link 1a to [Arrays-equals][java.util.Arrays#equals(Object[],Object[])] /// * Link 1b to [Arrays-equals][java.util.Arrays#equals(Object[],Object[])] /// * Link 2a to [java.util.Arrays#equals(Object[],Object[])] /// * Link 2b to [java.util.Arrays#equals(Object[],Object[])] public class C { } Link 1a and 2a end up as unprocessed "literal" text (because the `[]` were not escaped.) That is, they are not even recognized by the CommonMark parser as reference links. Link 1b and 2b get processed as links, as expected. FWIW, this issue with needing to escape `[]` pairs is specifically mentioned in the JEP as an inescapable (sic) limitation. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/16388#discussion_r1473593860 From jjg at openjdk.org Wed Jan 31 23:13:07 2024 From: jjg at openjdk.org (Jonathan Gibbons) Date: Wed, 31 Jan 2024 23:13:07 GMT Subject: RFR: JDK-8298405: Support Markdown in Documentation Comments [v7] In-Reply-To: References: <0pRMUgBnvCfb7DTm_pDnIlmuYdXH8URKFAIk5cT082Y=.f4c324b6-ef98-41b3-9b06-9cb82e03b08f@github.com> Message-ID: <9udnoUCtCVEEO3rIQypPb3f14bMp6wVRRO4x0yNKZpw=.b1245fbf-e2eb-44c1-9b44-76ccbefe200f@github.com> On Wed, 31 Jan 2024 23:09:22 GMT, Jonathan Gibbons wrote: >> My recollection is that you have to escape square brackets in a reference label. I will investigate, and if necessary, add a test case. > > Yes, you need to escape `[` and `]` within the label of any Markdown reference link, by preceding each with backslash. (Remember, the label is the string used to find the URL for the link; not the displayed text of the link). > That's a CommonMark feature independent of this work. > > While we could change that `replace` call into two separate ones, in reference signatures they always appear together as a pair, and can be replaced together. We need to remove the escape characters in the generated URL so that the signature is a standard signature with unescaped `[]` > > For fun/demo, try the following: > > > /// First sentence. > /// * Link 0 to [java.lang.Object] > /// * Link 1a to [Arrays-equals][java.util.Arrays#equals(Object[],Object[])] > /// * Link 1b to [Arrays-equals][java.util.Arrays#equals(Object[],Object[])] > /// * Link 2a to [java.util.Arrays#equals(Object[],Object[])] > /// * Link 2b to [java.util.Arrays#equals(Object[],Object[])] > public class C { } > > > Link 1a and 2a end up as unprocessed "literal" text (because the `[]` were not escaped.) That is, they are not even recognized by the CommonMark parser as reference links. Link 1b and 2b get processed as links, as expected. > > FWIW, this issue with needing to escape `[]` pairs is specifically mentioned in the JEP as an inescapable (sic) limitation. I'll add a test case. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/16388#discussion_r1473594252 From jjg at openjdk.org Wed Jan 31 23:49:25 2024 From: jjg at openjdk.org (Jonathan Gibbons) Date: Wed, 31 Jan 2024 23:49:25 GMT Subject: RFR: JDK-8298405: Support Markdown in Documentation Comments [v14] In-Reply-To: References: Message-ID: > Please review a patch to add support for Markdown syntax in documentation comments, as described in the associated JEP. > > Notable features: > > * support for `///` documentation comments in `JavaTokenizer` > * new module `jdk.internal.md` -- a private copy of the `commonmark-java` library > * updates to `DocCommentParser` to treat `///` comments as Markdown > * updates to the standard doclet to render Markdown comments in HTML Jonathan Gibbons has updated the pull request incrementally with one additional commit since the last revision: address review feedback for MarkdownTransformer `label.replace("\\[\\]", "[]");` add corresponding test case in TestMarkdown.java ------------- Changes: - all: https://git.openjdk.org/jdk/pull/16388/files - new: https://git.openjdk.org/jdk/pull/16388/files/71ce4b16..586daddf Webrevs: - full: https://webrevs.openjdk.org/?repo=jdk&pr=16388&range=13 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=16388&range=12-13 Stats: 60 lines in 2 files changed: 60 ins; 0 del; 0 mod Patch: https://git.openjdk.org/jdk/pull/16388.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/16388/head:pull/16388 PR: https://git.openjdk.org/jdk/pull/16388