From jjg at openjdk.org Fri Mar 1 21:49:29 2024
From: jjg at openjdk.org (Jonathan Gibbons)
Date: Fri, 1 Mar 2024 21:49:29 GMT
Subject: RFR: JDK-8298405: Support Markdown in Documentation Comments [v44]
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:
Revise `Markdown.update` to better handle container blocks.
-------------
Changes:
- all: https://git.openjdk.org/jdk/pull/16388/files
- new: https://git.openjdk.org/jdk/pull/16388/files/398f93fc..0b4d9b3c
Webrevs:
- full: https://webrevs.openjdk.org/?repo=jdk&pr=16388&range=43
- incr: https://webrevs.openjdk.org/?repo=jdk&pr=16388&range=42-43
Stats: 348 lines in 3 files changed: 226 ins; 43 del; 79 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 cstein at openjdk.org Mon Mar 4 08:18:25 2024
From: cstein at openjdk.org (Christian Stein)
Date: Mon, 4 Mar 2024 08:18:25 GMT
Subject: RFR: 8323605: Java source launcher should not require `--source
...` to enable preview [v4]
In-Reply-To:
References:
Message-ID: <18o5YIblHul4zgTjQ_zbQbORH-NPgvbiY0mTMhqYD4Y=.14d86d1c-4fb0-4e5c-8ec8-1430fb131bb5@github.com>
> Please review this PR targeting the source launcher that instead of throwing an error reading _"--enable-preview must be used with --source"_ adds the required compiler arguments on-the-fly.
>
> The add arguments are `--release` and `feature`, with `feature` being the release feature number of the current Java runtime as acquired by `Runtime.version().feature()`.
Christian Stein 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 five additional commits since the last revision:
- Update `java`'s man page
- Merge branch 'refs/heads/master' into JDK-8323605-launch-with-source-by-default
- Remove now outdated workaround
[skip ci]
- Update copyright dates
[skip ci]
- 8323605: Java source launcher should not require `--source ...` to enable preview
-------------
Changes:
- all: https://git.openjdk.org/jdk/pull/17731/files
- new: https://git.openjdk.org/jdk/pull/17731/files/23fba2bf..bb8eac9a
Webrevs:
- full: https://webrevs.openjdk.org/?repo=jdk&pr=17731&range=03
- incr: https://webrevs.openjdk.org/?repo=jdk&pr=17731&range=02-03
Stats: 48207 lines in 2199 files changed: 22996 ins; 14625 del; 10586 mod
Patch: https://git.openjdk.org/jdk/pull/17731.diff
Fetch: git fetch https://git.openjdk.org/jdk.git pull/17731/head:pull/17731
PR: https://git.openjdk.org/jdk/pull/17731
From prappo at openjdk.org Mon Mar 4 14:43:03 2024
From: prappo at openjdk.org (Pavel Rappo)
Date: Mon, 4 Mar 2024 14:43:03 GMT
Subject: RFR: JDK-8298405: Support Markdown in Documentation Comments [v44]
In-Reply-To:
References:
Message-ID: <0Ni2FJg13P97mkOqv-C_J-i2pyHagmCc5wrcXuzNYMw=.d3d617eb-42dc-4e54-93fb-2afe679202c8@github.com>
On Fri, 1 Mar 2024 21:49:29 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:
>
> Revise `Markdown.update` to better handle container blocks.
I have a test case to report. The following results in no `@param` information being rendered, which I think is a bug:
/// Hello, _Markdown_ world!
///
///
/// @param hello
///
///
public class C { }
-------------
PR Comment: https://git.openjdk.org/jdk/pull/16388#issuecomment-1976734010
From prappo at openjdk.org Mon Mar 4 15:19:05 2024
From: prappo at openjdk.org (Pavel Rappo)
Date: Mon, 4 Mar 2024 15:19:05 GMT
Subject: RFR: JDK-8298405: Support Markdown in Documentation Comments [v44]
In-Reply-To: <0Ni2FJg13P97mkOqv-C_J-i2pyHagmCc5wrcXuzNYMw=.d3d617eb-42dc-4e54-93fb-2afe679202c8@github.com>
References:
<0Ni2FJg13P97mkOqv-C_J-i2pyHagmCc5wrcXuzNYMw=.d3d617eb-42dc-4e54-93fb-2afe679202c8@github.com>
Message-ID:
On Mon, 4 Mar 2024 14:40:06 GMT, Pavel Rappo wrote:
> I have a test case to report. The following results in no `@param` information being rendered, which I think is a bug:
>
> ```
> /// Hello, _Markdown_ world!
> ///
> ///
> /// @param hello
> ///
> ///
> public class C { }
> ```
Scratch that. After experimenting a bit more with **traditional** javadoc comments, I realised that it might be expected that `@param` would be lost in that `
...
` block; okay.
Still, I find it surprising that the description of the `@param` tag in the above comment, hosted in `///` or `/**...*/`, is a single node of type `RawText` with the following content:
hello
(Note, the content includes ``.)
-------------
PR Comment: https://git.openjdk.org/jdk/pull/16388#issuecomment-1976818803
From jjg at openjdk.org Mon Mar 4 21:32:20 2024
From: jjg at openjdk.org (Jonathan Gibbons)
Date: Mon, 4 Mar 2024 21:32:20 GMT
Subject: RFR: JDK-8298405: Support Markdown in Documentation Comments [v45]
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 63 commits:
- fix test after merge
- Merge remote-tracking branch 'upstream/master' into 8298405.doclet-markdown-v3
- Revise `Markdown.update` to better handle container blocks.
- Refactor most of TestMarkdown.java into separate tests, grouped by functionality
- add support for (top-level) trailing code blocks
add simple test case with tabs
add TestMarkdownCodeBlocks.testTypical
- fix whitespace
- fix Markdown.update for new POST_LIST_INDENT test case given in review feedback
- refactor tests for Markdown headings into a separate test class.
- update DocCommentParser and tests to improve handling of code blocks and code spans in Markdown documentation comments
- fix indentation, for consistency
- ... and 53 more: https://git.openjdk.org/jdk/compare/6f8d351e...292ff0f1
-------------
Changes: https://git.openjdk.org/jdk/pull/16388/files
Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=16388&range=44
Stats: 23548 lines in 205 files changed: 22863 ins; 252 del; 433 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 Tue Mar 5 19:08:59 2024
From: jjg at openjdk.org (Jonathan Gibbons)
Date: Tue, 5 Mar 2024 19:08:59 GMT
Subject: RFR: JDK-8298405: Implement JEP 467: Markdown Documentation
Comments [v44]
In-Reply-To:
References:
<0Ni2FJg13P97mkOqv-C_J-i2pyHagmCc5wrcXuzNYMw=.d3d617eb-42dc-4e54-93fb-2afe679202c8@github.com>
Message-ID: <7j2wY4Kerf2flBeZbxOeSz35u0VYgKsctgcDvui1Ctk=.abd1e15b-861e-4e7e-a86e-e7451e47d8c9@github.com>
On Mon, 4 Mar 2024 15:16:32 GMT, Pavel Rappo wrote:
> > I have a test case to report. The following results in no `@param` information being rendered, which I think is a bug:
> > ```
> > /// Hello, _Markdown_ world!
> > ///
> > ///
> > /// @param hello
> > ///
> > ///
> > public class C { }
> > ```
>
> Scratch that. After experimenting a bit more with **traditional** javadoc comments, I realised that it might be expected that `@param` would be lost in that `
...
` block; okay.
>
> Still, I find it surprising that the description of the `@param` tag in the above comment, hosted in `///` or `/**...*/`, is a single node of type `RawText` with the following content:
>
> ```
> hello
>
> ```
>
> (Note, the content includes ``.)
The Markdown aspect of this is behaving about as well as can be expected. But the generated form is certainly confusing and can be considered a less-than-optimal presentation of a paragraph within a definition list. You can see the same behavior in a traditional comment with `@param
hello
`. Ideally, we could/should tweak the CSS for this situation, in a separate changeset.
-------------
PR Comment: https://git.openjdk.org/jdk/pull/16388#issuecomment-1979452615
From cushon at openjdk.org Tue Mar 5 20:30:10 2024
From: cushon at openjdk.org (Liam Miller-Cushon)
Date: Tue, 5 Mar 2024 20:30:10 GMT
Subject: RFR: 8043226: Better diagnostics for non-applicable type
annotations [v3]
In-Reply-To:
References:
Message-ID:
> 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 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-8043226
- Update src/jdk.compiler/share/classes/com/sun/tools/javac/comp/Attr.java
Co-authored-by: Werner Dietl
- 8043226: Better diagnostics for non-applicable type annotations
-------------
Changes:
- all: https://git.openjdk.org/jdk/pull/16592/files
- new: https://git.openjdk.org/jdk/pull/16592/files/568eb387..77aca669
Webrevs:
- full: https://webrevs.openjdk.org/?repo=jdk&pr=16592&range=02
- incr: https://webrevs.openjdk.org/?repo=jdk&pr=16592&range=01-02
Stats: 919411 lines in 7225 files changed: 244205 ins; 574251 del; 100955 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 Tue Mar 5 20:30:11 2024
From: cushon at openjdk.org (Liam Miller-Cushon)
Date: Tue, 5 Mar 2024 20:30:11 GMT
Subject: RFR: 8043226: Better diagnostics for non-applicable type
annotations [v2]
In-Reply-To: <4ymqDKx7z9VqfAjr93Dx7tVCUnJDoz_1TIY4oarSkoc=.26f92336-85b6-4549-a4a1-cb1d5a424d78@github.com>
References:
<4ymqDKx7z9VqfAjr93Dx7tVCUnJDoz_1TIY4oarSkoc=.26f92336-85b6-4549-a4a1-cb1d5a424d78@github.com>
Message-ID:
On Mon, 8 Jan 2024 19:12:34 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...
>
> 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
> Feel free to ask for assistance if you need help with progressing this pull request towards integration!
Any suggestions on how to progress this pull request are welcome.
-------------
PR Comment: https://git.openjdk.org/jdk/pull/16592#issuecomment-1979582358
From cushon at openjdk.org Wed Mar 6 20:35:20 2024
From: cushon at openjdk.org (Liam Miller-Cushon)
Date: Wed, 6 Mar 2024 20:35:20 GMT
Subject: RFR: 8291643: Consider omitting type annotations from type error
diagnostics [v2]
In-Reply-To:
References:
Message-ID:
> Hi,
>
> Please consider this fix for [JDK-8291643](https://bugs.openjdk.org/browse/JDK-8291643), which causes javac to remove type-use annotations when formatting types in diagnostics.
>
> For the example like the one in the bug, this change causes javac to emit the diagnostic like `incompatible types: List cannot be converted to List` rather than `incompatible types: List cannot be converted to List<@Nullable Number>`. Including the type annotations can be confusing, because they do not impact the type checking done by the compiler.
>
> An alternative I considered was to remove type annotations from types for specific diagnostics, instead of doing it unconditionally in diagnostic formatting. I can revisit that if the current approach seems too broad.
>
> The test update to `test/langtools/tools/javac/lambda/LambdaConv25.out` is because a `ForAll` is being formatted, and `stripMetadata()` uses a `StructuralTypeMapping` which rewrites away the `ForAll`.
Liam Miller-Cushon 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:
- Use Type stripping logic added for JDK-8042981
- Merge branch 'master' into JDK-8291643
- Updates based on review thread
* Support optionally printing types with type annotations
* Move handling of types in AbstractDiagnosticFormatter
* Make annotation removal more robust, don't rely on stripMetadata
- 8291643: Consider omitting type annotations from type error diagnostics
-------------
Changes:
- all: https://git.openjdk.org/jdk/pull/16578/files
- new: https://git.openjdk.org/jdk/pull/16578/files/f28bbf4d..7331c7cb
Webrevs:
- full: https://webrevs.openjdk.org/?repo=jdk&pr=16578&range=01
- incr: https://webrevs.openjdk.org/?repo=jdk&pr=16578&range=00-01
Stats: 919426 lines in 7228 files changed: 244212 ins; 574254 del; 100960 mod
Patch: https://git.openjdk.org/jdk/pull/16578.diff
Fetch: git fetch https://git.openjdk.org/jdk.git pull/16578/head:pull/16578
PR: https://git.openjdk.org/jdk/pull/16578
From cushon at openjdk.org Wed Mar 6 20:35:20 2024
From: cushon at openjdk.org (Liam Miller-Cushon)
Date: Wed, 6 Mar 2024 20:35:20 GMT
Subject: RFR: 8291643: Consider omitting type annotations from type error
diagnostics
In-Reply-To:
References:
Message-ID: <8tpqGL_mTN5EvRmDlFG360fIX1cH7U_bmGYvJVcItv0=.726c025d-5215-410a-8d3d-d2c20af96a37@github.com>
On Thu, 9 Nov 2023 00:47:10 GMT, Liam Miller-Cushon wrote:
> Hi,
>
> Please consider this fix for [JDK-8291643](https://bugs.openjdk.org/browse/JDK-8291643), which causes javac to remove type-use annotations when formatting types in diagnostics.
>
> For the example like the one in the bug, this change causes javac to emit the diagnostic like `incompatible types: List cannot be converted to List` rather than `incompatible types: List cannot be converted to List<@Nullable Number>`. Including the type annotations can be confusing, because they do not impact the type checking done by the compiler.
>
> An alternative I considered was to remove type annotations from types for specific diagnostics, instead of doing it unconditionally in diagnostic formatting. I can revisit that if the current approach seems too broad.
>
> The test update to `test/langtools/tools/javac/lambda/LambdaConv25.out` is because a `ForAll` is being formatted, and `stripMetadata()` uses a `StructuralTypeMapping` which rewrites away the `ForAll`.
I pushed a demo of some of the changes mentioned earlier, including an implementation of a `stripAnnotations` method that uses the approach I mentioned in https://github.com/openjdk/jdk/pull/8984#issuecomment-1806211798
> One possibility would be to have a trivial wrapper around the types used in diagnostic arguments, and then have the diagnostic formatter unwrap them and leave the annotations on
`AbstractDiagnosticFormatter` now removes type annotations from printed types by default, and there's a `JCDiagnostic.AnnotatedType` wrapper for diagnostics that want to opt-in to printing types with annotations. This isn't currently used in the PR, but https://github.com/openjdk/jdk/pull/16592 is an example of a diagnostic that wants to include type annotations.
Please keep this open for now
I updated this to use the `Type#stripMetadata` method added in https://bugs.openjdk.org/browse/JDK-8042981 to remove the type annotations, now that change has landed.
-------------
PR Comment: https://git.openjdk.org/jdk/pull/16578#issuecomment-1811517580
PR Comment: https://git.openjdk.org/jdk/pull/16578#issuecomment-1884004866
PR Comment: https://git.openjdk.org/jdk/pull/16578#issuecomment-1981730529
From jjg at openjdk.org Wed Mar 6 22:23:24 2024
From: jjg at openjdk.org (Jonathan Gibbons)
Date: Wed, 6 Mar 2024 22:23:24 GMT
Subject: RFR: JDK-8298405: Implement JEP 467: Markdown Documentation
Comments [v46]
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 `textOf` method to accommodate Markdown content.
- avoid relying on unspecified behavior `List.toString`
-------------
Changes:
- all: https://git.openjdk.org/jdk/pull/16388/files
- new: https://git.openjdk.org/jdk/pull/16388/files/292ff0f1..fc76e8c7
Webrevs:
- full: https://webrevs.openjdk.org/?repo=jdk&pr=16388&range=45
- incr: https://webrevs.openjdk.org/?repo=jdk&pr=16388&range=44-45
Stats: 43 lines in 3 files changed: 34 ins; 0 del; 9 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 jlahoda at openjdk.org Thu Mar 7 08:39:19 2024
From: jlahoda at openjdk.org (Jan Lahoda)
Date: Thu, 7 Mar 2024 08:39:19 GMT
Subject: RFR: 8325362: Allow to create a simple in-memory input JavaFileObject
Message-ID: <6KbXE6d6CHtDEoQ03C66d8eFAUyoUM_WhFjJYQiQkqk=.10b93b93-ab06-4b31-bb70-c82eda99a8db@github.com>
There are many subtypes of `SimpleJavaFileObject` scattered through various codebases, majority of them looking like:
private static class JavaSource extends SimpleJavaFileObject {
private String code;
public JavaSource(String code) {
super(URI.create("myfo:/Test.java"), JavaFileObject.Kind.SOURCE);
this.code = code;
}
@Override
public CharSequence getCharContent(boolean ignoreEncodingErrors) {
return code;
}
}
The proposal herein is a to add a factory method that would return an implementation of `SimpleJavaFileObject` based on the provided `URI` and source content.
The CSR for this change is available for review here:
https://bugs.openjdk.org/browse/JDK-8327536
-------------
Commit messages:
- Updating copyright year.
- Merge branch 'master' into JDK-8325362
- Adding test.
- Merge branch 'master' into JDK-8325362
- 8325362: Allow to create a simple in-memory input JavaFileObject
Changes: https://git.openjdk.org/jdk/pull/18149/files
Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=18149&range=00
Issue: https://bugs.openjdk.org/browse/JDK-8325362
Stats: 162 lines in 2 files changed: 162 ins; 0 del; 0 mod
Patch: https://git.openjdk.org/jdk/pull/18149.diff
Fetch: git fetch https://git.openjdk.org/jdk.git pull/18149/head:pull/18149
PR: https://git.openjdk.org/jdk/pull/18149
From jlaskey at openjdk.org Thu Mar 7 08:45:52 2024
From: jlaskey at openjdk.org (Jim Laskey)
Date: Thu, 7 Mar 2024 08:45:52 GMT
Subject: RFR: 8325362: Allow to create a simple in-memory input
JavaFileObject
In-Reply-To: <6KbXE6d6CHtDEoQ03C66d8eFAUyoUM_WhFjJYQiQkqk=.10b93b93-ab06-4b31-bb70-c82eda99a8db@github.com>
References: <6KbXE6d6CHtDEoQ03C66d8eFAUyoUM_WhFjJYQiQkqk=.10b93b93-ab06-4b31-bb70-c82eda99a8db@github.com>
Message-ID:
On Thu, 7 Mar 2024 08:34:32 GMT, Jan Lahoda wrote:
> There are many subtypes of `SimpleJavaFileObject` scattered through various codebases, majority of them looking like:
>
>
> private static class JavaSource extends SimpleJavaFileObject {
>
> private String code;
>
> public JavaSource(String code) {
> super(URI.create("myfo:/Test.java"), JavaFileObject.Kind.SOURCE);
> this.code = code;
> }
>
> @Override
> public CharSequence getCharContent(boolean ignoreEncodingErrors) {
> return code;
> }
> }
>
>
> The proposal herein is a to add a factory method that would return an implementation of `SimpleJavaFileObject` based on the provided `URI` and source content.
>
> The CSR for this change is available for review here:
> https://bugs.openjdk.org/browse/JDK-8327536
Marked as reviewed by jlaskey (Reviewer).
This is great.
-------------
PR Review: https://git.openjdk.org/jdk/pull/18149#pullrequestreview-1921805607
PR Comment: https://git.openjdk.org/jdk/pull/18149#issuecomment-1982971100
From jlaskey at openjdk.org Thu Mar 7 08:53:52 2024
From: jlaskey at openjdk.org (Jim Laskey)
Date: Thu, 7 Mar 2024 08:53:52 GMT
Subject: RFR: 8325362: Allow to create a simple in-memory input
JavaFileObject
In-Reply-To: <6KbXE6d6CHtDEoQ03C66d8eFAUyoUM_WhFjJYQiQkqk=.10b93b93-ab06-4b31-bb70-c82eda99a8db@github.com>
References: <6KbXE6d6CHtDEoQ03C66d8eFAUyoUM_WhFjJYQiQkqk=.10b93b93-ab06-4b31-bb70-c82eda99a8db@github.com>
Message-ID:
On Thu, 7 Mar 2024 08:34:32 GMT, Jan Lahoda wrote:
> There are many subtypes of `SimpleJavaFileObject` scattered through various codebases, majority of them looking like:
>
>
> private static class JavaSource extends SimpleJavaFileObject {
>
> private String code;
>
> public JavaSource(String code) {
> super(URI.create("myfo:/Test.java"), JavaFileObject.Kind.SOURCE);
> this.code = code;
> }
>
> @Override
> public CharSequence getCharContent(boolean ignoreEncodingErrors) {
> return code;
> }
> }
>
>
> The proposal herein is a to add a factory method that would return an implementation of `SimpleJavaFileObject` based on the provided `URI` and source content.
>
> The CSR for this change is available for review here:
> https://bugs.openjdk.org/browse/JDK-8327536
Should consider including an end to end compile a text block example. I for one am always hunting around for the model when I need it.
-------------
PR Comment: https://git.openjdk.org/jdk/pull/18149#issuecomment-1982993882
From jpai at openjdk.org Thu Mar 7 10:51:59 2024
From: jpai at openjdk.org (Jaikiran Pai)
Date: Thu, 7 Mar 2024 10:51:59 GMT
Subject: RFR: 8325362: Allow to create a simple in-memory input
JavaFileObject
In-Reply-To: <6KbXE6d6CHtDEoQ03C66d8eFAUyoUM_WhFjJYQiQkqk=.10b93b93-ab06-4b31-bb70-c82eda99a8db@github.com>
References: <6KbXE6d6CHtDEoQ03C66d8eFAUyoUM_WhFjJYQiQkqk=.10b93b93-ab06-4b31-bb70-c82eda99a8db@github.com>
Message-ID:
On Thu, 7 Mar 2024 08:34:32 GMT, Jan Lahoda wrote:
> There are many subtypes of `SimpleJavaFileObject` scattered through various codebases, majority of them looking like:
>
>
> private static class JavaSource extends SimpleJavaFileObject {
>
> private String code;
>
> public JavaSource(String code) {
> super(URI.create("myfo:/Test.java"), JavaFileObject.Kind.SOURCE);
> this.code = code;
> }
>
> @Override
> public CharSequence getCharContent(boolean ignoreEncodingErrors) {
> return code;
> }
> }
>
>
> The proposal herein is a to add a factory method that would return an implementation of `SimpleJavaFileObject` based on the provided `URI` and source content.
>
> The CSR for this change is available for review here:
> https://bugs.openjdk.org/browse/JDK-8327536
src/java.compiler/share/classes/javax/tools/SimpleJavaFileObject.java line 228:
> 226:
> 227: /**
> 228: * Creates a {@link JavaFileObject} which will be represents the given source content.
Hello Jan, should this have been `which represents the given source content.` ?
src/java.compiler/share/classes/javax/tools/SimpleJavaFileObject.java line 235:
> 233: *
> 234: *
All other methods will behave as described in the documentation in this class,
> 235: * if the constructor is called with {@code uri} and {@code Kind.SOURCE}.
Should this have been `as if the constructor ...`
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/18149#discussion_r1515949515
PR Review Comment: https://git.openjdk.org/jdk/pull/18149#discussion_r1515949948
From jpai at openjdk.org Thu Mar 7 10:55:56 2024
From: jpai at openjdk.org (Jaikiran Pai)
Date: Thu, 7 Mar 2024 10:55:56 GMT
Subject: RFR: 8325362: Allow to create a simple in-memory input
JavaFileObject
In-Reply-To: <6KbXE6d6CHtDEoQ03C66d8eFAUyoUM_WhFjJYQiQkqk=.10b93b93-ab06-4b31-bb70-c82eda99a8db@github.com>
References: <6KbXE6d6CHtDEoQ03C66d8eFAUyoUM_WhFjJYQiQkqk=.10b93b93-ab06-4b31-bb70-c82eda99a8db@github.com>
Message-ID:
On Thu, 7 Mar 2024 08:34:32 GMT, Jan Lahoda wrote:
> There are many subtypes of `SimpleJavaFileObject` scattered through various codebases, majority of them looking like:
>
>
> private static class JavaSource extends SimpleJavaFileObject {
>
> private String code;
>
> public JavaSource(String code) {
> super(URI.create("myfo:/Test.java"), JavaFileObject.Kind.SOURCE);
> this.code = code;
> }
>
> @Override
> public CharSequence getCharContent(boolean ignoreEncodingErrors) {
> return code;
> }
> }
>
>
> The proposal herein is a to add a factory method that would return an implementation of `SimpleJavaFileObject` based on the provided `URI` and source content.
>
> The CSR for this change is available for review here:
> https://bugs.openjdk.org/browse/JDK-8327536
src/java.compiler/share/classes/javax/tools/SimpleJavaFileObject.java line 237:
> 235: * if the constructor is called with {@code uri} and {@code Kind.SOURCE}.
> 236: *
> 237: * @param uri that should be used for this {@code JavaFileObject}
I realize this is a static method, but the use of "this" might mean to imply the current instance on which the method is invoked. Perhaps, we should change it to `that should be used by the returned {@code JavaFileObject}` ? Or maybe just replace "this" with "the"?
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/18149#discussion_r1515954825
From darcy at openjdk.org Thu Mar 7 17:20:56 2024
From: darcy at openjdk.org (Joe Darcy)
Date: Thu, 7 Mar 2024 17:20:56 GMT
Subject: RFR: 8325362: Allow to create a simple in-memory input
JavaFileObject
In-Reply-To: <6KbXE6d6CHtDEoQ03C66d8eFAUyoUM_WhFjJYQiQkqk=.10b93b93-ab06-4b31-bb70-c82eda99a8db@github.com>
References: <6KbXE6d6CHtDEoQ03C66d8eFAUyoUM_WhFjJYQiQkqk=.10b93b93-ab06-4b31-bb70-c82eda99a8db@github.com>
Message-ID:
On Thu, 7 Mar 2024 08:34:32 GMT, Jan Lahoda wrote:
> There are many subtypes of `SimpleJavaFileObject` scattered through various codebases, majority of them looking like:
>
>
> private static class JavaSource extends SimpleJavaFileObject {
>
> private String code;
>
> public JavaSource(String code) {
> super(URI.create("myfo:/Test.java"), JavaFileObject.Kind.SOURCE);
> this.code = code;
> }
>
> @Override
> public CharSequence getCharContent(boolean ignoreEncodingErrors) {
> return code;
> }
> }
>
>
> The proposal herein is a to add a factory method that would return an implementation of `SimpleJavaFileObject` based on the provided `URI` and source content.
>
> The CSR for this change is available for review here:
> https://bugs.openjdk.org/browse/JDK-8327536
Are there existing uses of this pattern in the regression tests that can be converted to use the new API?
-------------
PR Comment: https://git.openjdk.org/jdk/pull/18149#issuecomment-1984042522
From jlahoda at openjdk.org Thu Mar 7 23:13:06 2024
From: jlahoda at openjdk.org (Jan Lahoda)
Date: Thu, 7 Mar 2024 23:13:06 GMT
Subject: RFR: 8325362: Allow to create a simple in-memory input
JavaFileObject [v2]
In-Reply-To: <6KbXE6d6CHtDEoQ03C66d8eFAUyoUM_WhFjJYQiQkqk=.10b93b93-ab06-4b31-bb70-c82eda99a8db@github.com>
References: <6KbXE6d6CHtDEoQ03C66d8eFAUyoUM_WhFjJYQiQkqk=.10b93b93-ab06-4b31-bb70-c82eda99a8db@github.com>
Message-ID:
> There are many subtypes of `SimpleJavaFileObject` scattered through various codebases, majority of them looking like:
>
>
> private static class JavaSource extends SimpleJavaFileObject {
>
> private String code;
>
> public JavaSource(String code) {
> super(URI.create("myfo:/Test.java"), JavaFileObject.Kind.SOURCE);
> this.code = code;
> }
>
> @Override
> public CharSequence getCharContent(boolean ignoreEncodingErrors) {
> return code;
> }
> }
>
>
> The proposal herein is a to add a factory method that would return an implementation of `SimpleJavaFileObject` based on the provided `URI` and source content.
>
> The CSR for this change is available for review here:
> https://bugs.openjdk.org/browse/JDK-8327536
Jan Lahoda has updated the pull request incrementally with six additional commits since the last revision:
- Removing trailing whitespaces.
- Updating tests to use the new SimpleJavaFileObject.forSource
- Not using schema in the URI.
- Using URI.create instead of new URI in the sample.
- Reflecting review comments.
- Adding a sample code snippet.
-------------
Changes:
- all: https://git.openjdk.org/jdk/pull/18149/files
- new: https://git.openjdk.org/jdk/pull/18149/files/56efc6e1..52416a1b
Webrevs:
- full: https://webrevs.openjdk.org/?repo=jdk&pr=18149&range=01
- incr: https://webrevs.openjdk.org/?repo=jdk&pr=18149&range=00-01
Stats: 200 lines in 22 files changed: 19 ins; 111 del; 70 mod
Patch: https://git.openjdk.org/jdk/pull/18149.diff
Fetch: git fetch https://git.openjdk.org/jdk.git pull/18149/head:pull/18149
PR: https://git.openjdk.org/jdk/pull/18149
From jlahoda at openjdk.org Thu Mar 7 23:13:06 2024
From: jlahoda at openjdk.org (Jan Lahoda)
Date: Thu, 7 Mar 2024 23:13:06 GMT
Subject: RFR: 8325362: Allow to create a simple in-memory input
JavaFileObject
In-Reply-To: <6KbXE6d6CHtDEoQ03C66d8eFAUyoUM_WhFjJYQiQkqk=.10b93b93-ab06-4b31-bb70-c82eda99a8db@github.com>
References: <6KbXE6d6CHtDEoQ03C66d8eFAUyoUM_WhFjJYQiQkqk=.10b93b93-ab06-4b31-bb70-c82eda99a8db@github.com>
Message-ID:
On Thu, 7 Mar 2024 08:34:32 GMT, Jan Lahoda wrote:
> There are many subtypes of `SimpleJavaFileObject` scattered through various codebases, majority of them looking like:
>
>
> private static class JavaSource extends SimpleJavaFileObject {
>
> private String code;
>
> public JavaSource(String code) {
> super(URI.create("myfo:/Test.java"), JavaFileObject.Kind.SOURCE);
> this.code = code;
> }
>
> @Override
> public CharSequence getCharContent(boolean ignoreEncodingErrors) {
> return code;
> }
> }
>
>
> The proposal herein is a to add a factory method that would return an implementation of `SimpleJavaFileObject` based on the provided `URI` and source content.
>
> The CSR for this change is available for review here:
> https://bugs.openjdk.org/browse/JDK-8327536
Thanks for the comments so far. I've tried to:
- add a sample snippet
- adjust the javadoc as suggest
- convert existing tests to use the new method (those that I could find and update)
-------------
PR Comment: https://git.openjdk.org/jdk/pull/18149#issuecomment-1984753425
From jjg at openjdk.org Thu Mar 7 23:32:23 2024
From: jjg at openjdk.org (Jonathan Gibbons)
Date: Thu, 7 Mar 2024 23:32:23 GMT
Subject: RFR: JDK-8298405: Implement JEP 467: Markdown Documentation
Comments [v47]
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:
add test cases for links to anchors
-------------
Changes:
- all: https://git.openjdk.org/jdk/pull/16388/files
- new: https://git.openjdk.org/jdk/pull/16388/files/fc76e8c7..8dfd9e08
Webrevs:
- full: https://webrevs.openjdk.org/?repo=jdk&pr=16388&range=46
- incr: https://webrevs.openjdk.org/?repo=jdk&pr=16388&range=45-46
Stats: 60 lines in 1 file 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
From darcy at openjdk.org Fri Mar 8 03:02:54 2024
From: darcy at openjdk.org (Joe Darcy)
Date: Fri, 8 Mar 2024 03:02:54 GMT
Subject: RFR: 8325362: Allow to create a simple in-memory input
JavaFileObject [v2]
In-Reply-To:
References: <6KbXE6d6CHtDEoQ03C66d8eFAUyoUM_WhFjJYQiQkqk=.10b93b93-ab06-4b31-bb70-c82eda99a8db@github.com>
Message-ID:
On Thu, 7 Mar 2024 23:13:06 GMT, Jan Lahoda wrote:
>> There are many subtypes of `SimpleJavaFileObject` scattered through various codebases, majority of them looking like:
>>
>>
>> private static class JavaSource extends SimpleJavaFileObject {
>>
>> private String code;
>>
>> public JavaSource(String code) {
>> super(URI.create("myfo:/Test.java"), JavaFileObject.Kind.SOURCE);
>> this.code = code;
>> }
>>
>> @Override
>> public CharSequence getCharContent(boolean ignoreEncodingErrors) {
>> return code;
>> }
>> }
>>
>>
>> The proposal herein is a to add a factory method that would return an implementation of `SimpleJavaFileObject` based on the provided `URI` and source content.
>>
>> The CSR for this change is available for review here:
>> https://bugs.openjdk.org/browse/JDK-8327536
>
> Jan Lahoda has updated the pull request incrementally with six additional commits since the last revision:
>
> - Removing trailing whitespaces.
> - Updating tests to use the new SimpleJavaFileObject.forSource
> - Not using schema in the URI.
> - Using URI.create instead of new URI in the sample.
> - Reflecting review comments.
> - Adding a sample code snippet.
Good to see the change in use in the regression tests; I assume any copyright updates will be done before pushing.
-------------
Marked as reviewed by darcy (Reviewer).
PR Review: https://git.openjdk.org/jdk/pull/18149#pullrequestreview-1923941820
From jpai at openjdk.org Fri Mar 8 04:06:53 2024
From: jpai at openjdk.org (Jaikiran Pai)
Date: Fri, 8 Mar 2024 04:06:53 GMT
Subject: RFR: 8325362: Allow to create a simple in-memory input
JavaFileObject [v2]
In-Reply-To:
References: <6KbXE6d6CHtDEoQ03C66d8eFAUyoUM_WhFjJYQiQkqk=.10b93b93-ab06-4b31-bb70-c82eda99a8db@github.com>
Message-ID:
On Thu, 7 Mar 2024 23:13:06 GMT, Jan Lahoda wrote:
>> There are many subtypes of `SimpleJavaFileObject` scattered through various codebases, majority of them looking like:
>>
>>
>> private static class JavaSource extends SimpleJavaFileObject {
>>
>> private String code;
>>
>> public JavaSource(String code) {
>> super(URI.create("myfo:/Test.java"), JavaFileObject.Kind.SOURCE);
>> this.code = code;
>> }
>>
>> @Override
>> public CharSequence getCharContent(boolean ignoreEncodingErrors) {
>> return code;
>> }
>> }
>>
>>
>> The proposal herein is a to add a factory method that would return an implementation of `SimpleJavaFileObject` based on the provided `URI` and source content.
>>
>> The CSR for this change is available for review here:
>> https://bugs.openjdk.org/browse/JDK-8327536
>
> Jan Lahoda has updated the pull request incrementally with six additional commits since the last revision:
>
> - Removing trailing whitespaces.
> - Updating tests to use the new SimpleJavaFileObject.forSource
> - Not using schema in the URI.
> - Using URI.create instead of new URI in the sample.
> - Reflecting review comments.
> - Adding a sample code snippet.
Thank you Jan for the updates. The javadoc changes look good to me.
-------------
PR Review: https://git.openjdk.org/jdk/pull/18149#pullrequestreview-1923986147
From jlahoda at openjdk.org Fri Mar 8 10:19:17 2024
From: jlahoda at openjdk.org (Jan Lahoda)
Date: Fri, 8 Mar 2024 10:19:17 GMT
Subject: RFR: 8325362: Allow to create a simple in-memory input
JavaFileObject [v3]
In-Reply-To: <6KbXE6d6CHtDEoQ03C66d8eFAUyoUM_WhFjJYQiQkqk=.10b93b93-ab06-4b31-bb70-c82eda99a8db@github.com>
References: <6KbXE6d6CHtDEoQ03C66d8eFAUyoUM_WhFjJYQiQkqk=.10b93b93-ab06-4b31-bb70-c82eda99a8db@github.com>
Message-ID: <_FwDFqhoDvhgTfVbgGgM79QPwekvljLpee0W2fKgwZ8=.ac82faa4-5551-4778-aab7-84573fa48de1@github.com>
> There are many subtypes of `SimpleJavaFileObject` scattered through various codebases, majority of them looking like:
>
>
> private static class JavaSource extends SimpleJavaFileObject {
>
> private String code;
>
> public JavaSource(String code) {
> super(URI.create("myfo:/Test.java"), JavaFileObject.Kind.SOURCE);
> this.code = code;
> }
>
> @Override
> public CharSequence getCharContent(boolean ignoreEncodingErrors) {
> return code;
> }
> }
>
>
> The proposal herein is a to add a factory method that would return an implementation of `SimpleJavaFileObject` based on the provided `URI` and source content.
>
> The CSR for this change is available for review here:
> https://bugs.openjdk.org/browse/JDK-8327536
Jan Lahoda has updated the pull request incrementally with one additional commit since the last revision:
Updating license headers.
-------------
Changes:
- all: https://git.openjdk.org/jdk/pull/18149/files
- new: https://git.openjdk.org/jdk/pull/18149/files/52416a1b..dba3bc9d
Webrevs:
- full: https://webrevs.openjdk.org/?repo=jdk&pr=18149&range=02
- incr: https://webrevs.openjdk.org/?repo=jdk&pr=18149&range=01-02
Stats: 20 lines in 20 files changed: 2 ins; 0 del; 18 mod
Patch: https://git.openjdk.org/jdk/pull/18149.diff
Fetch: git fetch https://git.openjdk.org/jdk.git pull/18149/head:pull/18149
PR: https://git.openjdk.org/jdk/pull/18149
From abimpoudis at openjdk.org Fri Mar 8 11:19:17 2024
From: abimpoudis at openjdk.org (Aggelos Biboudis)
Date: Fri, 8 Mar 2024 11:19:17 GMT
Subject: RFR: 8327683: Crash with primitive type pattern and generic expression
in instanceof
Message-ID:
When compiling the following code, javac results in `java.lang.AssertionError: T.intValue`:
public static boolean wideningReferenceConversionUnboxing(T i) {
return i instanceof int ii;
}
The translated code after `Lower`, results in a generated assignment `(int)i.intValue()`. The reason for this bug is that the variable `i` required to have the erased type, set. This PR addresses this issue in `TransPatterns`:
public static boolean wideningReferenceConversionUnboxing(Integer i) {
return (let int ii in
(let /*synthetic*/ final T tmp4500$ = i in tmp4500$ != null && (let /*synthetic*/ final T tmp4500$ = i in tmp4500$ != null)) &&
(let ii = (int)i.intValue(); in true));
}
We also observe a duplicated check in the generated code: `(let /*synthetic*/ final T tmp4500$ = i in tmp4500$ != null`. This PR also tidies up the relevant code transformation in `Lower`.
-------------
Commit messages:
- 8327683: Crash with primitive type pattern and generic expression in instanceof
Changes: https://git.openjdk.org/jdk/pull/18168/files
Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=18168&range=00
Issue: https://bugs.openjdk.org/browse/JDK-8327683
Stats: 241 lines in 5 files changed: 204 ins; 15 del; 22 mod
Patch: https://git.openjdk.org/jdk/pull/18168.diff
Fetch: git fetch https://git.openjdk.org/jdk.git pull/18168/head:pull/18168
PR: https://git.openjdk.org/jdk/pull/18168
From jlaskey at openjdk.org Fri Mar 8 12:11:53 2024
From: jlaskey at openjdk.org (Jim Laskey)
Date: Fri, 8 Mar 2024 12:11:53 GMT
Subject: RFR: 8325362: Allow to create a simple in-memory input
JavaFileObject [v3]
In-Reply-To: <_FwDFqhoDvhgTfVbgGgM79QPwekvljLpee0W2fKgwZ8=.ac82faa4-5551-4778-aab7-84573fa48de1@github.com>
References: <6KbXE6d6CHtDEoQ03C66d8eFAUyoUM_WhFjJYQiQkqk=.10b93b93-ab06-4b31-bb70-c82eda99a8db@github.com>
<_FwDFqhoDvhgTfVbgGgM79QPwekvljLpee0W2fKgwZ8=.ac82faa4-5551-4778-aab7-84573fa48de1@github.com>
Message-ID:
On Fri, 8 Mar 2024 10:19:17 GMT, Jan Lahoda wrote:
>> There are many subtypes of `SimpleJavaFileObject` scattered through various codebases, majority of them looking like:
>>
>>
>> private static class JavaSource extends SimpleJavaFileObject {
>>
>> private String code;
>>
>> public JavaSource(String code) {
>> super(URI.create("myfo:/Test.java"), JavaFileObject.Kind.SOURCE);
>> this.code = code;
>> }
>>
>> @Override
>> public CharSequence getCharContent(boolean ignoreEncodingErrors) {
>> return code;
>> }
>> }
>>
>>
>> The proposal herein is a to add a factory method that would return an implementation of `SimpleJavaFileObject` based on the provided `URI` and source content.
>>
>> The CSR for this change is available for review here:
>> https://bugs.openjdk.org/browse/JDK-8327536
>
> Jan Lahoda has updated the pull request incrementally with one additional commit since the last revision:
>
> Updating license headers.
LGTM
-------------
Marked as reviewed by jlaskey (Reviewer).
PR Review: https://git.openjdk.org/jdk/pull/18149#pullrequestreview-1924745292
From abimpoudis at openjdk.org Sun Mar 10 15:58:19 2024
From: abimpoudis at openjdk.org (Aggelos Biboudis)
Date: Sun, 10 Mar 2024 15:58:19 GMT
Subject: RFR: 8327683: Crash with primitive type pattern and generic
expression in instanceof [v2]
In-Reply-To:
References:
Message-ID:
> When compiling the following code, javac results in `java.lang.AssertionError: T.intValue`:
>
>
> public static boolean wideningReferenceConversionUnboxing(T i) {
> return i instanceof int ii;
> }
>
>
> The translated code after `Lower`, results in a generated assignment `(int)i.intValue()`. The reason for this bug is that the variable `i` required to have the erased type, set. This PR addresses this issue in `TransPatterns`:
>
>
> public static boolean wideningReferenceConversionUnboxing(Integer i) {
> return (let int ii in
> (let /*synthetic*/ final T tmp4500$ = i in tmp4500$ != null && (let /*synthetic*/ final T tmp4500$ = i in tmp4500$ != null)) &&
> (let ii = (int)i.intValue(); in true));
> }
>
>
> We also observe a duplicated check in the generated code: `(let /*synthetic*/ final T tmp4500$ = i in tmp4500$ != null`. This PR also tidies up the relevant code transformation in `Lower`.
Aggelos Biboudis has updated the pull request with a new target base due to a merge or a rebase. The incremental webrev excludes the unrelated changes brought in by the merge/rebase. The pull request contains two additional commits since the last revision:
- Merge branch 'master' into fix-#8327683
- 8327683: Crash with primitive type pattern and generic expression in instanceof
-------------
Changes:
- all: https://git.openjdk.org/jdk/pull/18168/files
- new: https://git.openjdk.org/jdk/pull/18168/files/aaf20903..d57b0456
Webrevs:
- full: https://webrevs.openjdk.org/?repo=jdk&pr=18168&range=01
- incr: https://webrevs.openjdk.org/?repo=jdk&pr=18168&range=00-01
Stats: 7955 lines in 150 files changed: 3776 ins; 3694 del; 485 mod
Patch: https://git.openjdk.org/jdk/pull/18168.diff
Fetch: git fetch https://git.openjdk.org/jdk.git pull/18168/head:pull/18168
PR: https://git.openjdk.org/jdk/pull/18168
From dholmes at openjdk.org Sun Mar 10 21:46:56 2024
From: dholmes at openjdk.org (David Holmes)
Date: Sun, 10 Mar 2024 21:46:56 GMT
Subject: RFR: 8323605: Java source launcher should not require `--source
...` to enable preview [v4]
In-Reply-To: <18o5YIblHul4zgTjQ_zbQbORH-NPgvbiY0mTMhqYD4Y=.14d86d1c-4fb0-4e5c-8ec8-1430fb131bb5@github.com>
References:
<18o5YIblHul4zgTjQ_zbQbORH-NPgvbiY0mTMhqYD4Y=.14d86d1c-4fb0-4e5c-8ec8-1430fb131bb5@github.com>
Message-ID:
On Mon, 4 Mar 2024 08:18:25 GMT, Christian Stein wrote:
>> Please review this PR targeting the source launcher that instead of throwing an error reading _"--enable-preview must be used with --source"_ adds the required compiler arguments on-the-fly.
>>
>> The add arguments are `--release` and `feature`, with `feature` being the release feature number of the current Java runtime as acquired by `Runtime.version().feature()`.
>
> Christian Stein 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 five additional commits since the last revision:
>
> - Update `java`'s man page
> - Merge branch 'refs/heads/master' into JDK-8323605-launch-with-source-by-default
> - Remove now outdated workaround
>
> [skip ci]
> - Update copyright dates
>
> [skip ci]
> - 8323605: Java source launcher should not require `--source ...` to enable preview
src/java.base/share/man/java.1 line 284:
> 282: If \f[V]--enable-preview\f[R] is specified, the \f[V]--source N\f[R]
> 283: arguments can be omitted.
> 284: The Java Runtime of version \f[V]N\f[R] implies an implicit
I think that should be `A Java runtime version ...`
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/17731#discussion_r1518990161
From dholmes at openjdk.org Sun Mar 10 21:53:56 2024
From: dholmes at openjdk.org (David Holmes)
Date: Sun, 10 Mar 2024 21:53:56 GMT
Subject: RFR: 8323605: Java source launcher should not require `--source
...` to enable preview [v4]
In-Reply-To:
References:
<18o5YIblHul4zgTjQ_zbQbORH-NPgvbiY0mTMhqYD4Y=.14d86d1c-4fb0-4e5c-8ec8-1430fb131bb5@github.com>
Message-ID:
On Sun, 10 Mar 2024 21:44:03 GMT, David Holmes wrote:
>> Christian Stein 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 five additional commits since the last revision:
>>
>> - Update `java`'s man page
>> - Merge branch 'refs/heads/master' into JDK-8323605-launch-with-source-by-default
>> - Remove now outdated workaround
>>
>> [skip ci]
>> - Update copyright dates
>>
>> [skip ci]
>> - 8323605: Java source launcher should not require `--source ...` to enable preview
>
> src/java.base/share/man/java.1 line 284:
>
>> 282: If \f[V]--enable-preview\f[R] is specified, the \f[V]--source N\f[R]
>> 283: arguments can be omitted.
>> 284: The Java Runtime of version \f[V]N\f[R] implies an implicit
>
> I think that should be `A Java runtime version ...`
Also `implies an implicit` is doubling up. I suggest the following complete sentence:
If the Java runtime version is N, then `--release N` is implied when compiling source files.
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/17731#discussion_r1518991164
From abimpoudis at openjdk.org Mon Mar 11 16:42:27 2024
From: abimpoudis at openjdk.org (Aggelos Biboudis)
Date: Mon, 11 Mar 2024 16:42:27 GMT
Subject: RFR: 8326204: yield statements doesn't allow cast expressions with
more than 1 type arguments
Message-ID:
A valid use of `yield` that includes a cast to a generic type with multiple parameters, was misdetected by `blockStatement` in parser. This PR addresses this issue.
-------------
Commit messages:
- 8326204: yield statements doesn't allow cast expressions with more than 1 type arguments
Changes: https://git.openjdk.org/jdk/pull/18196/files
Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=18196&range=00
Issue: https://bugs.openjdk.org/browse/JDK-8326204
Stats: 62 lines in 2 files changed: 61 ins; 0 del; 1 mod
Patch: https://git.openjdk.org/jdk/pull/18196.diff
Fetch: git fetch https://git.openjdk.org/jdk.git pull/18196/head:pull/18196
PR: https://git.openjdk.org/jdk/pull/18196
From jlahoda at openjdk.org Mon Mar 11 16:42:27 2024
From: jlahoda at openjdk.org (Jan Lahoda)
Date: Mon, 11 Mar 2024 16:42:27 GMT
Subject: RFR: 8326204: yield statements doesn't allow cast expressions with
more than 1 type arguments
In-Reply-To:
References:
Message-ID:
On Mon, 11 Mar 2024 14:23:38 GMT, Aggelos Biboudis wrote:
> A valid use of `yield` that includes a cast to a generic type with multiple parameters, was misdetected by `blockStatement` in parser. This PR addresses this issue.
Looks good, with one suggestion for consideration.
src/jdk.compiler/share/classes/com/sun/tools/javac/parser/JavacParser.java line 2897:
> 2895: int balance = 1;
> 2896: boolean hasComma = false;
> 2897: boolean hasTypeArgs = false;
For consideration, may also balance out the `<`/`>`, to cover cases like this:
private static int t(int i) {
yield((Map) null, 2);
}
private static void yield(Map m, int j) {
}
Not critical, as this is error recovery anyway, so for consideration only.
-------------
Marked as reviewed by jlahoda (Reviewer).
PR Review: https://git.openjdk.org/jdk/pull/18196#pullrequestreview-1928189455
PR Review Comment: https://git.openjdk.org/jdk/pull/18196#discussion_r1519935963
From aturbanov at openjdk.org Mon Mar 11 18:16:54 2024
From: aturbanov at openjdk.org (Andrey Turbanov)
Date: Mon, 11 Mar 2024 18:16:54 GMT
Subject: RFR: 8325936: jshell - crash on 'new Object().""'
In-Reply-To:
References:
Message-ID:
On Thu, 15 Feb 2024 16:55:31 GMT, Hannes Greule wrote:
> This fixes a crash in jshell when the target of a StringTemplate is not a processor. We only look up the `process` method if the type is actually a processor. The added test case fails without that fix.
>
> Please let me know what you think of this fix, and if there are things that should be changed.
src/jdk.compiler/share/classes/com/sun/tools/javac/comp/Check.java line 4482:
> 4480: Type interfaceType = types.asSuper(processorType, syms.processorType.tsym);
> 4481:
> 4482: if (interfaceType == null) {
Suggestion:
if (interfaceType == null) {
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/17876#discussion_r1520210961
From jjg at openjdk.org Mon Mar 11 22:02:30 2024
From: jjg at openjdk.org (Jonathan Gibbons)
Date: Mon, 11 Mar 2024 22:02:30 GMT
Subject: RFR: JDK-8298405: Implement JEP 467: Markdown Documentation
Comments [v48]
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:
improve first-sentence break in Markdown comments
-------------
Changes:
- all: https://git.openjdk.org/jdk/pull/16388/files
- new: https://git.openjdk.org/jdk/pull/16388/files/8dfd9e08..81279a74
Webrevs:
- full: https://webrevs.openjdk.org/?repo=jdk&pr=16388&range=47
- incr: https://webrevs.openjdk.org/?repo=jdk&pr=16388&range=46-47
Stats: 50 lines in 2 files changed: 45 ins; 0 del; 5 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 Mar 11 23:53:33 2024
From: jjg at openjdk.org (Jonathan Gibbons)
Date: Mon, 11 Mar 2024 23:53:33 GMT
Subject: RFR: JDK-8298405: Implement JEP 467: Markdown Documentation
Comments [v49]
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 68 commits:
- Merge with upstream/master
- improve first-sentence break in Markdown comments
- add test cases for links to anchors
- fix `textOf` method to accommodate Markdown content.
- avoid relying on unspecified behavior `List.toString`
- fix test after merge
- Merge remote-tracking branch 'upstream/master' into 8298405.doclet-markdown-v3
- Revise `Markdown.update` to better handle container blocks.
- Refactor most of TestMarkdown.java into separate tests, grouped by functionality
- add support for (top-level) trailing code blocks
add simple test case with tabs
add TestMarkdownCodeBlocks.testTypical
- ... and 58 more: https://git.openjdk.org/jdk/compare/586396cb...76eccbf4
-------------
Changes: https://git.openjdk.org/jdk/pull/16388/files
Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=16388&range=48
Stats: 23757 lines in 208 files changed: 23030 ins; 281 del; 446 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 Mar 12 14:11:32 2024
From: abimpoudis at openjdk.org (Aggelos Biboudis)
Date: Tue, 12 Mar 2024 14:11:32 GMT
Subject: RFR: 8327839: Crash with unboxing and widening primitive conversion in
switch
Message-ID:
In cases where the compiler needs to unbox a `long`, `float`, `double` and then run the exactness check, we were getting a crash. While the selector value is always boxed, the type (which controls the execution flow) was not, because the `selectorType` was wrong. This PR addresses this bug.
-------------
Commit messages:
- 8327839: Crash with unboxing and widening primitive conversion in switch
Changes: https://git.openjdk.org/jdk/pull/18236/files
Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=18236&range=00
Issue: https://bugs.openjdk.org/browse/JDK-8327839
Stats: 111 lines in 5 files changed: 99 ins; 0 del; 12 mod
Patch: https://git.openjdk.org/jdk/pull/18236.diff
Fetch: git fetch https://git.openjdk.org/jdk.git pull/18236/head:pull/18236
PR: https://git.openjdk.org/jdk/pull/18236
From cstein at openjdk.org Tue Mar 12 15:59:26 2024
From: cstein at openjdk.org (Christian Stein)
Date: Tue, 12 Mar 2024 15:59:26 GMT
Subject: RFR: 8323605: Java source launcher should not require `--source
...` to enable preview [v5]
In-Reply-To:
References:
Message-ID: <-QBM8H1Pd_m5jPlXkqjQ_82D1RR7riOPNVkqul-qZQk=.0714650d-4a22-4d80-ad92-100ad387b1ed@github.com>
> Please review this PR targeting the source launcher that instead of throwing an error reading _"--enable-preview must be used with --source"_ adds the required compiler arguments on-the-fly.
>
> The add arguments are `--release` and `feature`, with `feature` being the release feature number of the current Java runtime as acquired by `Runtime.version().feature()`.
Christian Stein has updated the pull request incrementally with one additional commit since the last revision:
Update to suggested sentence
-------------
Changes:
- all: https://git.openjdk.org/jdk/pull/17731/files
- new: https://git.openjdk.org/jdk/pull/17731/files/bb8eac9a..a82e4fe3
Webrevs:
- full: https://webrevs.openjdk.org/?repo=jdk&pr=17731&range=04
- incr: https://webrevs.openjdk.org/?repo=jdk&pr=17731&range=03-04
Stats: 3 lines in 1 file changed: 0 ins; 1 del; 2 mod
Patch: https://git.openjdk.org/jdk/pull/17731.diff
Fetch: git fetch https://git.openjdk.org/jdk.git pull/17731/head:pull/17731
PR: https://git.openjdk.org/jdk/pull/17731
From cstein at openjdk.org Tue Mar 12 16:02:16 2024
From: cstein at openjdk.org (Christian Stein)
Date: Tue, 12 Mar 2024 16:02:16 GMT
Subject: RFR: 8323605: Java source launcher should not require `--source
...` to enable preview [v4]
In-Reply-To:
References:
<18o5YIblHul4zgTjQ_zbQbORH-NPgvbiY0mTMhqYD4Y=.14d86d1c-4fb0-4e5c-8ec8-1430fb131bb5@github.com>
Message-ID:
On Sun, 10 Mar 2024 21:50:59 GMT, David Holmes wrote:
>> src/java.base/share/man/java.1 line 284:
>>
>>> 282: If \f[V]--enable-preview\f[R] is specified, the \f[V]--source N\f[R]
>>> 283: arguments can be omitted.
>>> 284: The Java Runtime of version \f[V]N\f[R] implies an implicit
>>
>> I think that should be `A Java runtime version ...`
>
> Also `implies an implicit` is doubling up. I suggest the following complete sentence:
>
> If the Java runtime version is N, then `--release N` is implied when compiling source files.
Done via https://github.com/openjdk/jdk/pull/17731/commits/a82e4fe3d05a411635bbce0a69e17218184e7ab6
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/17731#discussion_r1521736000
From cstein at openjdk.org Tue Mar 12 16:06:24 2024
From: cstein at openjdk.org (Christian Stein)
Date: Tue, 12 Mar 2024 16:06:24 GMT
Subject: RFR: 8323605: Java source launcher should not require `--source
...` to enable preview [v6]
In-Reply-To:
References:
Message-ID:
> Please review this PR targeting the source launcher that instead of throwing an error reading _"--enable-preview must be used with --source"_ adds the required compiler arguments on-the-fly.
>
> The add arguments are `--release` and `feature`, with `feature` being the release feature number of the current Java runtime as acquired by `Runtime.version().feature()`.
Christian Stein has updated the pull request incrementally with one additional commit since the last revision:
Remove superfluous backticks
-------------
Changes:
- all: https://git.openjdk.org/jdk/pull/17731/files
- new: https://git.openjdk.org/jdk/pull/17731/files/a82e4fe3..dccb064e
Webrevs:
- full: https://webrevs.openjdk.org/?repo=jdk&pr=17731&range=05
- incr: https://webrevs.openjdk.org/?repo=jdk&pr=17731&range=04-05
Stats: 1 line in 1 file changed: 0 ins; 0 del; 1 mod
Patch: https://git.openjdk.org/jdk/pull/17731.diff
Fetch: git fetch https://git.openjdk.org/jdk.git pull/17731/head:pull/17731
PR: https://git.openjdk.org/jdk/pull/17731
From abimpoudis at openjdk.org Tue Mar 12 17:30:47 2024
From: abimpoudis at openjdk.org (Aggelos Biboudis)
Date: Tue, 12 Mar 2024 17:30:47 GMT
Subject: RFR: 8326204: yield statements doesn't allow cast expressions with
more than 1 type arguments [v2]
In-Reply-To:
References:
Message-ID:
> A valid use of `yield` that includes a cast to a generic type with multiple parameters, was misdetected by `blockStatement` in parser. This PR addresses this issue.
Aggelos Biboudis has updated the pull request incrementally with one additional commit since the last revision:
Address comments
-------------
Changes:
- all: https://git.openjdk.org/jdk/pull/18196/files
- new: https://git.openjdk.org/jdk/pull/18196/files/25f6ffec..f688c1e3
Webrevs:
- full: https://webrevs.openjdk.org/?repo=jdk&pr=18196&range=01
- incr: https://webrevs.openjdk.org/?repo=jdk&pr=18196&range=00-01
Stats: 21 lines in 4 files changed: 16 ins; 0 del; 5 mod
Patch: https://git.openjdk.org/jdk/pull/18196.diff
Fetch: git fetch https://git.openjdk.org/jdk.git pull/18196/head:pull/18196
PR: https://git.openjdk.org/jdk/pull/18196
From dholmes at openjdk.org Wed Mar 13 06:40:19 2024
From: dholmes at openjdk.org (David Holmes)
Date: Wed, 13 Mar 2024 06:40:19 GMT
Subject: RFR: 8323605: Java source launcher should not require `--source
...` to enable preview [v6]
In-Reply-To:
References:
Message-ID:
On Tue, 12 Mar 2024 16:06:24 GMT, Christian Stein wrote:
>> Please review this PR targeting the source launcher that instead of throwing an error reading _"--enable-preview must be used with --source"_ adds the required compiler arguments on-the-fly.
>>
>> The add arguments are `--release` and `feature`, with `feature` being the release feature number of the current Java runtime as acquired by `Runtime.version().feature()`.
>
> Christian Stein has updated the pull request incrementally with one additional commit since the last revision:
>
> Remove superfluous backticks
manpage update is good. Thanks
-------------
Marked as reviewed by dholmes (Reviewer).
PR Review: https://git.openjdk.org/jdk/pull/17731#pullrequestreview-1933262272
From cstein at openjdk.org Wed Mar 13 06:48:24 2024
From: cstein at openjdk.org (Christian Stein)
Date: Wed, 13 Mar 2024 06:48:24 GMT
Subject: Integrated: 8323605: Java source launcher should not require `--source
...` to enable preview
In-Reply-To:
References:
Message-ID: <-H_mhLBd9_vxYOM1SlD8GsaHqH2FMqMemp5EvkcRMog=.2f4717c4-75ce-4902-9199-4ee57687e74d@github.com>
On Tue, 6 Feb 2024 12:01:04 GMT, Christian Stein wrote:
> Please review this PR targeting the source launcher that instead of throwing an error reading _"--enable-preview must be used with --source"_ adds the required compiler arguments on-the-fly.
>
> The add arguments are `--release` and `feature`, with `feature` being the release feature number of the current Java runtime as acquired by `Runtime.version().feature()`.
This pull request has now been integrated.
Changeset: 3b18c5dc
Author: Christian Stein
URL: https://git.openjdk.org/jdk/commit/3b18c5dc5d5885fe5ebaabd9cd74f033a584e4ae
Stats: 26 lines in 5 files changed: 7 ins; 11 del; 8 mod
8323605: Java source launcher should not require `--source ...` to enable preview
Reviewed-by: mcimadamore, dholmes
-------------
PR: https://git.openjdk.org/jdk/pull/17731
From abimpoudis at openjdk.org Wed Mar 13 10:53:13 2024
From: abimpoudis at openjdk.org (Aggelos Biboudis)
Date: Wed, 13 Mar 2024 10:53:13 GMT
Subject: RFR: 8326204: yield statements doesn't allow cast expressions with
more than 1 type arguments [v2]
In-Reply-To:
References:
Message-ID:
On Mon, 11 Mar 2024 15:38:34 GMT, Jan Lahoda wrote:
>> Aggelos Biboudis has updated the pull request incrementally with one additional commit since the last revision:
>>
>> Address comments
>
> src/jdk.compiler/share/classes/com/sun/tools/javac/parser/JavacParser.java line 2897:
>
>> 2895: int balance = 1;
>> 2896: boolean hasComma = false;
>> 2897: boolean hasTypeArgs = false;
>
> For consideration, may also balance out the `<`/`>`, to cover cases like this:
>
> private static int t(int i) {
> yield((Map) null, 2);
> }
>
> private static void yield(Map m, int j) {
>
> }
>
>
> Not critical, as this is error recovery anyway, so for consideration only.
Addressed. Thanks @lahodaj
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/18196#discussion_r1522993223
From abimpoudis at openjdk.org Thu Mar 14 07:04:47 2024
From: abimpoudis at openjdk.org (Aggelos Biboudis)
Date: Thu, 14 Mar 2024 07:04:47 GMT
Subject: Integrated: 8326204: yield statements doesn't allow cast expressions
with more than 1 type arguments
In-Reply-To:
References:
Message-ID:
On Mon, 11 Mar 2024 14:23:38 GMT, Aggelos Biboudis wrote:
> A valid use of `yield` that includes a cast to a generic type with multiple parameters, was misdetected by `blockStatement` in parser. This PR addresses this issue.
This pull request has now been integrated.
Changeset: cff0747d
Author: Aggelos Biboudis
URL: https://git.openjdk.org/jdk/commit/cff0747d7f62efc3dafcd259ef2b15cd13bafbeb
Stats: 78 lines in 4 files changed: 77 ins; 0 del; 1 mod
8326204: yield statements doesn't allow cast expressions with more than 1 type arguments
Reviewed-by: jlahoda
-------------
PR: https://git.openjdk.org/jdk/pull/18196
From mchung at openjdk.org Thu Mar 14 17:39:50 2024
From: mchung at openjdk.org (Mandy Chung)
Date: Thu, 14 Mar 2024 17:39:50 GMT
Subject: RFR: 8326979: (jdeps) improve the error message for FindException
caused by InvalidModuleDescriptorException
Message-ID:
Trivial fix. Improve the error message to print the cause of the module resolution failure if present.
-------------
Commit messages:
- 8326979: (jdeps) improve the error message for FindException caused by InvalidModuleDescriptorException
Changes: https://git.openjdk.org/jdk/pull/18308/files
Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=18308&range=00
Issue: https://bugs.openjdk.org/browse/JDK-8326979
Stats: 89 lines in 2 files changed: 88 ins; 0 del; 1 mod
Patch: https://git.openjdk.org/jdk/pull/18308.diff
Fetch: git fetch https://git.openjdk.org/jdk.git pull/18308/head:pull/18308
PR: https://git.openjdk.org/jdk/pull/18308
From jpai at openjdk.org Fri Mar 15 01:29:37 2024
From: jpai at openjdk.org (Jaikiran Pai)
Date: Fri, 15 Mar 2024 01:29:37 GMT
Subject: RFR: 8326979: (jdeps) improve the error message for FindException
caused by InvalidModuleDescriptorException
In-Reply-To:
References:
Message-ID: <2aAHIoub3_KoC-XLtG-4TRhGgzb94aLiHMM2IHvSifM=.1f1e6684-b8a6-41a0-b97a-3e537b3c8578@github.com>
On Thu, 14 Mar 2024 17:35:22 GMT, Mandy Chung wrote:
> Trivial fix. Improve the error message to print the cause of the module resolution failure if present.
Hello Mandy, this change to use the underlying cause of `ResolutionExcepion` and `FindException` when reporting the error message, appears OK to me.
I didn't know if `ResolutionException` too wraps the actual cause underneath, so I looked around a few JBS issues where `ResolutionException` was reported as being thrown and it does appear that the actual cause lies underneath. So I think this change is fine.
-------------
Marked as reviewed by jpai (Reviewer).
PR Review: https://git.openjdk.org/jdk/pull/18308#pullrequestreview-1937969339
From alanb at openjdk.org Fri Mar 15 06:42:38 2024
From: alanb at openjdk.org (Alan Bateman)
Date: Fri, 15 Mar 2024 06:42:38 GMT
Subject: RFR: 8326979: (jdeps) improve the error message for FindException
caused by InvalidModuleDescriptorException
In-Reply-To:
References:
Message-ID:
On Thu, 14 Mar 2024 17:35:22 GMT, Mandy Chung wrote:
> Trivial fix. Improve the error message to print the cause of the module resolution failure if present.
Tests that depend on exception messages can be problematic but this one is easy to change if/when the exception message changes.
-------------
Marked as reviewed by alanb (Reviewer).
PR Review: https://git.openjdk.org/jdk/pull/18308#pullrequestreview-1938210400
From jlahoda at openjdk.org Fri Mar 15 13:03:54 2024
From: jlahoda at openjdk.org (Jan Lahoda)
Date: Fri, 15 Mar 2024 13:03:54 GMT
Subject: RFR: 8327839: Crash with unboxing and widening primitive
conversion in switch
In-Reply-To:
References:
Message-ID:
On Tue, 12 Mar 2024 14:06:11 GMT, Aggelos Biboudis wrote:
> In cases where the compiler needs to unbox a `long`, `float`, `double` and then run the exactness check, we were getting a crash. While the selector value is always boxed, the type (which controls the execution flow) was not, because the `selectorType` was wrong. This PR addresses this bug.
Looks reasonable to me.
-------------
Marked as reviewed by jlahoda (Reviewer).
PR Review: https://git.openjdk.org/jdk/pull/18236#pullrequestreview-1938900922
From aturbanov at openjdk.org Sat Mar 16 22:18:23 2024
From: aturbanov at openjdk.org (Andrey Turbanov)
Date: Sat, 16 Mar 2024 22:18:23 GMT
Subject: RFR: 8327839: Crash with unboxing and widening primitive
conversion in switch
In-Reply-To:
References:
Message-ID:
On Tue, 12 Mar 2024 14:06:11 GMT, Aggelos Biboudis wrote:
> In cases where the compiler needs to unbox a `long`, `float`, `double` and then run the exactness check, we were getting a crash. While the selector value is always boxed, the type (which controls the execution flow) was not, because the `selectorType` was wrong. This PR addresses this bug.
test/langtools/tools/javac/patterns/PrimitivePatternsSwitch.java line 121:
> 119: assertEquals(Float.MAX_VALUE, testUnboxingAndWideningFloat(Float.MAX_VALUE));
> 120: assertEquals(Float.MAX_VALUE, testUnboxingAndWideningFloatExplicitCast(Float.MAX_VALUE));
> 121: assertEquals(42f, testUnboxingAndWideningLong(42l));
Suggestion:
assertEquals(42f, testUnboxingAndWideningLong(42L));
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/18236#discussion_r1527165787
From jjg at openjdk.org Sat Mar 16 22:25:06 2024
From: jjg at openjdk.org (Jonathan Gibbons)
Date: Sat, 16 Mar 2024 22:25:06 GMT
Subject: RFR: JDK-8298405: Implement JEP 467: Markdown Documentation
Comments [v50]
In-Reply-To:
References:
Message-ID: <5iwOoEAgMLQAlSM2lel0c_hb0eV_rI0pRA1H4FTFpk0=.67fa5f21-25b3-417a-b9fc-ae31695708b7@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 69 commits:
- Merge with upstream/master
- Merge with upstream/master
- improve first-sentence break in Markdown comments
- add test cases for links to anchors
- fix `textOf` method to accommodate Markdown content.
- avoid relying on unspecified behavior `List.toString`
- fix test after merge
- Merge remote-tracking branch 'upstream/master' into 8298405.doclet-markdown-v3
- Revise `Markdown.update` to better handle container blocks.
- Refactor most of TestMarkdown.java into separate tests, grouped by functionality
- ... and 59 more: https://git.openjdk.org/jdk/compare/65a84c26...635af77d
-------------
Changes: https://git.openjdk.org/jdk/pull/16388/files
Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=16388&range=49
Stats: 23526 lines in 208 files changed: 22955 ins; 228 del; 343 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 acobbs at openjdk.org Sun Mar 17 22:45:32 2024
From: acobbs at openjdk.org (Archie Cobbs)
Date: Sun, 17 Mar 2024 22:45:32 GMT
Subject: RFR: 8324736: Invalid end positions for EMPTY_STATEMENT [v2]
In-Reply-To:
References:
<_SVXTU-6FrRb22P-dMVT4ohUBm_UUOzviExP75V57tU=.2665e11a-1f1f-49c2-98a6-4d0c69baacc3@github.com>
Message-ID:
On Sat, 24 Feb 2024 01:17:01 GMT, Vicente Romero wrote:
>> Archie Cobbs has updated the pull request with a new target base due to a merge or a rebase. The incremental webrev excludes the unrelated changes brought in by the merge/rebase. The pull request contains two additional commits since the last revision:
>>
>> - Merge branch 'master' into JDK-8324736
>> - Fix bug where source positions got reversed.
>
> lgtm
@vicente-romero-oracle any interest in sponsoring this so we can wrap it up? Thanks.
-------------
PR Comment: https://git.openjdk.org/jdk/pull/17595#issuecomment-2002642908
From abimpoudis at openjdk.org Mon Mar 18 08:53:29 2024
From: abimpoudis at openjdk.org (Aggelos Biboudis)
Date: Mon, 18 Mar 2024 08:53:29 GMT
Subject: RFR: 8327839: Crash with unboxing and widening primitive
conversion in switch [v2]
In-Reply-To:
References:
Message-ID: <2znGbxx7HVg1nNv4AURxwAs22uRivO_v35-uTHm1ceM=.b47fa1fa-92f5-4d10-832e-37f4e1a15659@github.com>
> In cases where the compiler needs to unbox a `long`, `float`, `double` and then run the exactness check, we were getting a crash. While the selector value is always boxed, the type (which controls the execution flow) was not, because the `selectorType` was wrong. This PR addresses this bug.
Aggelos Biboudis has updated the pull request incrementally with one additional commit since the last revision:
Update test/langtools/tools/javac/patterns/PrimitivePatternsSwitch.java
Co-authored-by: Andrey Turbanov
-------------
Changes:
- all: https://git.openjdk.org/jdk/pull/18236/files
- new: https://git.openjdk.org/jdk/pull/18236/files/ecf909d0..50275918
Webrevs:
- full: https://webrevs.openjdk.org/?repo=jdk&pr=18236&range=01
- incr: https://webrevs.openjdk.org/?repo=jdk&pr=18236&range=00-01
Stats: 1 line in 1 file changed: 0 ins; 0 del; 1 mod
Patch: https://git.openjdk.org/jdk/pull/18236.diff
Fetch: git fetch https://git.openjdk.org/jdk.git pull/18236/head:pull/18236
PR: https://git.openjdk.org/jdk/pull/18236
From cstein at openjdk.org Mon Mar 18 10:55:52 2024
From: cstein at openjdk.org (Christian Stein)
Date: Mon, 18 Mar 2024 10:55:52 GMT
Subject: RFR: JDK-8328339: Static import prevents source launcher from finding
class with main method
Message-ID:
Please review this fix for finding the program class in case the first top-level type has no main method and the order of type compilation does not match the order in the source file - for example by a static import statement being present.
Here's an excerpt from [JEP 458](https://openjdk.org/jeps/458#Launch-time-semantics-and-operation)'s "Launch-time semantics and operation" section describing the process:
> 5. Determine the launch class of the initial .java file. If the first top level class in the initial file declares a standard main method (`public static void main(String[])` or other standard main entry points as defined in [JEP 463](https://openjdk.org/jeps/463#A-flexible-launch-protocol)), then that class is the launch class. Otherwise, if another top level class in the initial file declares a standard main method and has same name as the file, that class is the launch class. Otherwise, there is no launch class, and the launcher reports an error and stops.
-------------
Commit messages:
- JDK-8328339: Static import prevents source launcher from finding class with main method
Changes: https://git.openjdk.org/jdk/pull/18345/files
Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=18345&range=00
Issue: https://bugs.openjdk.org/browse/JDK-8328339
Stats: 27 lines in 2 files changed: 25 ins; 0 del; 2 mod
Patch: https://git.openjdk.org/jdk/pull/18345.diff
Fetch: git fetch https://git.openjdk.org/jdk.git pull/18345/head:pull/18345
PR: https://git.openjdk.org/jdk/pull/18345
From abimpoudis at openjdk.org Mon Mar 18 13:19:31 2024
From: abimpoudis at openjdk.org (Aggelos Biboudis)
Date: Mon, 18 Mar 2024 13:19:31 GMT
Subject: Integrated: 8327839: Crash with unboxing and widening primitive
conversion in switch
In-Reply-To:
References:
Message-ID: <6PEReV6E54AAZf2Qiiouqh89xGj3QhmgKyWla5rtChI=.ca66d96b-db04-4564-8fad-b4341c8405b3@github.com>
On Tue, 12 Mar 2024 14:06:11 GMT, Aggelos Biboudis wrote:
> In cases where the compiler needs to unbox a `long`, `float`, `double` and then run the exactness check, we were getting a crash. While the selector value is always boxed, the type (which controls the execution flow) was not, because the `selectorType` was wrong. This PR addresses this bug.
This pull request has now been integrated.
Changeset: fb390d20
Author: Aggelos Biboudis
URL: https://git.openjdk.org/jdk/commit/fb390d202c8bbbbb87ba48fd01387feb35a1b768
Stats: 111 lines in 5 files changed: 99 ins; 0 del; 12 mod
8327839: Crash with unboxing and widening primitive conversion in switch
Reviewed-by: jlahoda
-------------
PR: https://git.openjdk.org/jdk/pull/18236
From jjg at openjdk.org Mon Mar 18 15:11:28 2024
From: jjg at openjdk.org (Jonathan Gibbons)
Date: Mon, 18 Mar 2024 15:11:28 GMT
Subject: RFR: 8297879: javadoc link to preview JEP 1000 has grouping
character comma
In-Reply-To: <1_igawz8T_HtBuu7XHnp5a7MdBKn1faVA5zBCr2T9bU=.dc2b11f7-84db-4db8-9752-9fd4eb4bd695@github.com>
References: <1_igawz8T_HtBuu7XHnp5a7MdBKn1faVA5zBCr2T9bU=.dc2b11f7-84db-4db8-9752-9fd4eb4bd695@github.com>
Message-ID:
On Mon, 18 Mar 2024 14:53:44 GMT, Pavel Rappo wrote:
> Please review this simple bugfix to properly construct links to preview JEPs.
>
> The most straightforward fix I could think of was to pass `String` rather than `int` (`Integer`) to a method, which eventually calls `java.text.MessageFormat.format(String, Object...)`.
>
> For the test, I decided to be ~lazy~ practical and piggyback on the existing infrastructure. The alternatives were:
>
> 1. slap `noreg-hard` on the JBS bug and skip testing
> 2. create a sophisticated test that dynamically adds a constant into the `PreviewFeature.Feature` enum, annotates some class with `PreviewFeature` with that constant, and finally documents that class with `PreviewFeature` patched into `java.base`
>
> While (1) is insufficient, (2) seems overkill in this case.
Marked as reviewed by jjg (Reviewer).
-------------
PR Review: https://git.openjdk.org/jdk/pull/18350#pullrequestreview-1943374124
From prappo at openjdk.org Mon Mar 18 15:11:29 2024
From: prappo at openjdk.org (Pavel Rappo)
Date: Mon, 18 Mar 2024 15:11:29 GMT
Subject: RFR: 8297879: javadoc link to preview JEP 1000 has grouping
character comma
In-Reply-To: <1_igawz8T_HtBuu7XHnp5a7MdBKn1faVA5zBCr2T9bU=.dc2b11f7-84db-4db8-9752-9fd4eb4bd695@github.com>
References: <1_igawz8T_HtBuu7XHnp5a7MdBKn1faVA5zBCr2T9bU=.dc2b11f7-84db-4db8-9752-9fd4eb4bd695@github.com>
Message-ID:
On Mon, 18 Mar 2024 14:53:44 GMT, Pavel Rappo wrote:
> Please review this simple bugfix to properly construct links to preview JEPs.
>
> The most straightforward fix I could think of was to pass `String` rather than `int` (`Integer`) to a method, which eventually calls `java.text.MessageFormat.format(String, Object...)`.
>
> For the test, I decided to be ~lazy~ practical and piggyback on the existing infrastructure. The alternatives were:
>
> 1. slap `noreg-hard` on the JBS bug and skip testing
> 2. create a sophisticated test that dynamically adds a constant into the `PreviewFeature.Feature` enum, annotates some class with `PreviewFeature` with that constant, and finally documents that class with `PreviewFeature` patched into `java.base`
>
> While (1) is insufficient, (2) seems overkill in this case.
Hm... it's surprising to see that the Skara bots consider that src/java.base/share/classes/jdk/internal/javac/PreviewFeature.java belongs to core-libs, but not to compiler. Let me manually add it.
-------------
PR Comment: https://git.openjdk.org/jdk/pull/18350#issuecomment-2004168270
From vromero at openjdk.org Mon Mar 18 16:28:27 2024
From: vromero at openjdk.org (Vicente Romero)
Date: Mon, 18 Mar 2024 16:28:27 GMT
Subject: RFR: 8297879: javadoc link to preview JEP 1000 has grouping
character comma
In-Reply-To: <1_igawz8T_HtBuu7XHnp5a7MdBKn1faVA5zBCr2T9bU=.dc2b11f7-84db-4db8-9752-9fd4eb4bd695@github.com>
References: <1_igawz8T_HtBuu7XHnp5a7MdBKn1faVA5zBCr2T9bU=.dc2b11f7-84db-4db8-9752-9fd4eb4bd695@github.com>
Message-ID:
On Mon, 18 Mar 2024 14:53:44 GMT, Pavel Rappo wrote:
> Please review this simple bugfix to properly construct links to preview JEPs.
>
> The most straightforward fix I could think of was to pass `String` rather than `int` (`Integer`) to a method, which eventually calls `java.text.MessageFormat.format(String, Object...)`.
>
> For the test, I decided to be ~lazy~ practical and piggyback on the existing infrastructure. The alternatives were:
>
> 1. slap `noreg-hard` on the JBS bug and skip testing
> 2. create a sophisticated test that dynamically adds a constant into the `PreviewFeature.Feature` enum, annotates some class with `PreviewFeature` with that constant, and finally documents that class with `PreviewFeature` patched into `java.base`
>
> While (1) is insufficient, (2) seems overkill in this case.
lgtm
-------------
Marked as reviewed by vromero (Reviewer).
PR Review: https://git.openjdk.org/jdk/pull/18350#pullrequestreview-1943594610
From cstein at openjdk.org Mon Mar 18 17:12:38 2024
From: cstein at openjdk.org (Christian Stein)
Date: Mon, 18 Mar 2024 17:12:38 GMT
Subject: RFR: JDK-8328339: Static import prevents source launcher from
finding class with main method [v2]
In-Reply-To:
References:
Message-ID:
> Please review this fix for finding the program class in case the first top-level type has no main method and the order of type compilation does not match the order in the source file - for example by a static import statement being present.
>
> Here's an excerpt from [JEP 458](https://openjdk.org/jeps/458#Launch-time-semantics-and-operation)'s "Launch-time semantics and operation" section describing the process:
>> 5. Determine the launch class of the initial .java file. If the first top level class in the initial file declares a standard main method (`public static void main(String[])` or other standard main entry points as defined in [JEP 463](https://openjdk.org/jeps/463#A-flexible-launch-protocol)), then that class is the launch class. Otherwise, if another top level class in the initial file declares a standard main method and has same name as the file, that class is the launch class. Otherwise, there is no launch class, and the launcher reports an error and stops.
Christian Stein has updated the pull request incrementally with one additional commit since the last revision:
Ensure source-order of declared types in program source file
Move computation of declared types into program descriptor factory.
-------------
Changes:
- all: https://git.openjdk.org/jdk/pull/18345/files
- new: https://git.openjdk.org/jdk/pull/18345/files/ead7fd7b..65fba8d6
Webrevs:
- full: https://webrevs.openjdk.org/?repo=jdk&pr=18345&range=01
- incr: https://webrevs.openjdk.org/?repo=jdk&pr=18345&range=00-01
Stats: 73 lines in 4 files changed: 24 ins; 31 del; 18 mod
Patch: https://git.openjdk.org/jdk/pull/18345.diff
Fetch: git fetch https://git.openjdk.org/jdk.git pull/18345/head:pull/18345
PR: https://git.openjdk.org/jdk/pull/18345
From jlahoda at openjdk.org Mon Mar 18 17:43:30 2024
From: jlahoda at openjdk.org (Jan Lahoda)
Date: Mon, 18 Mar 2024 17:43:30 GMT
Subject: RFR: JDK-8328339: Static import prevents source launcher from
finding class with main method [v2]
In-Reply-To:
References:
Message-ID:
On Mon, 18 Mar 2024 17:12:38 GMT, Christian Stein wrote:
>> Please review this fix for finding the program class in case the first top-level type has no main method and the order of type compilation does not match the order in the source file - for example by a static import statement being present.
>>
>> Here's an excerpt from [JEP 458](https://openjdk.org/jeps/458#Launch-time-semantics-and-operation)'s "Launch-time semantics and operation" section describing the process:
>>> 5. Determine the launch class of the initial .java file. If the first top level class in the initial file declares a standard main method (`public static void main(String[])` or other standard main entry points as defined in [JEP 463](https://openjdk.org/jeps/463#A-flexible-launch-protocol)), then that class is the launch class. Otherwise, if another top level class in the initial file declares a standard main method and has same name as the file, that class is the launch class. Otherwise, there is no launch class, and the launcher reports an error and stops.
>
> Christian Stein has updated the pull request incrementally with one additional commit since the last revision:
>
> Ensure source-order of declared types in program source file
>
> Move computation of declared types into program descriptor factory.
Overall, looks good to me. Some suggestions for years in the headers + a potential suggestion to re-order gathering the declared types and package name, so that the qualified names can be computed in one step.
src/jdk.compiler/share/classes/com/sun/tools/javac/launcher/MemoryContext.java line 2:
> 1: /*
> 2: * Copyright (c) 2024, Oracle and/or its affiliates. All rights reserved.
Suggestion:
* Copyright (c) 2023, 2024, Oracle and/or its affiliates. All rights reserved.
src/jdk.compiler/share/classes/com/sun/tools/javac/launcher/ProgramDescriptor.java line 2:
> 1: /*
> 2: * Copyright (c) 2024, Oracle and/or its affiliates. All rights reserved.
Suggestion:
* Copyright (c) 2023, 2024, Oracle and/or its affiliates. All rights reserved.
src/jdk.compiler/share/classes/com/sun/tools/javac/launcher/ProgramDescriptor.java line 66:
> 64: var task = compiler.getTask(null, standardFileManager, diagnostic -> {}, null, null, units);
> 65: for (var tree : task.parse()) {
> 66: for (var decl : tree.getTypeDecls()) {
Not terribly important, but you could first compute the package name, and then compute the declared types. That would permit creating the fully qualified `declaredTypeNames` in one step, rather than putting the simple names into a List and then going through them again to qualify them.
src/jdk.compiler/share/classes/com/sun/tools/javac/launcher/SourceLauncher.java line 2:
> 1: /*
> 2: * Copyright (c) 2024, Oracle and/or its affiliates. All rights reserved.
Suggestion:
* Copyright (c) 2023, 2024, Oracle and/or its affiliates. All rights reserved.
-------------
PR Review: https://git.openjdk.org/jdk/pull/18345#pullrequestreview-1943765732
PR Review Comment: https://git.openjdk.org/jdk/pull/18345#discussion_r1528988234
PR Review Comment: https://git.openjdk.org/jdk/pull/18345#discussion_r1528988646
PR Review Comment: https://git.openjdk.org/jdk/pull/18345#discussion_r1528995167
PR Review Comment: https://git.openjdk.org/jdk/pull/18345#discussion_r1528990277
From jjg at openjdk.org Mon Mar 18 18:44:53 2024
From: jjg at openjdk.org (Jonathan Gibbons)
Date: Mon, 18 Mar 2024 18:44:53 GMT
Subject: RFR: JDK-8298405: Implement JEP 467: Markdown Documentation
Comments [v51]
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 71 commits:
- update man page
- Merge remote-tracking branch 'upstream/master' into 8298405.doclet-markdown-v3
- Merge with upstream/master
- Merge with upstream/master
- improve first-sentence break in Markdown comments
- add test cases for links to anchors
- fix `textOf` method to accommodate Markdown content.
- avoid relying on unspecified behavior `List.toString`
- fix test after merge
- Merge remote-tracking branch 'upstream/master' into 8298405.doclet-markdown-v3
- ... and 61 more: https://git.openjdk.org/jdk/compare/c901da48...03652d2f
-------------
Changes: https://git.openjdk.org/jdk/pull/16388/files
Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=16388&range=50
Stats: 23609 lines in 209 files changed: 22986 ins; 254 del; 369 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 Mar 19 08:42:34 2024
From: abimpoudis at openjdk.org (Aggelos Biboudis)
Date: Tue, 19 Mar 2024 08:42:34 GMT
Subject: RFR: 8327683: Crash with primitive type pattern and generic
expression in instanceof [v3]
In-Reply-To:
References:
Message-ID:
> When compiling the following code, javac results in `java.lang.AssertionError: T.intValue`:
>
>
> public static boolean wideningReferenceConversionUnboxing(T i) {
> return i instanceof int ii;
> }
>
>
> The translated code after `Lower`, results in a generated assignment `(int)i.intValue()`. The reason for this bug is that the variable `i` required to have the erased type, set. This PR addresses this issue in `TransPatterns`:
>
>
> public static boolean wideningReferenceConversionUnboxing(Integer i) {
> return (let int ii in
> (let /*synthetic*/ final T tmp4500$ = i in tmp4500$ != null && (let /*synthetic*/ final T tmp4500$ = i in tmp4500$ != null)) &&
> (let ii = (int)i.intValue(); in true));
> }
>
>
> We also observe a duplicated check in the generated code: `(let /*synthetic*/ final T tmp4500$ = i in tmp4500$ != null`. This PR also tidies up the relevant code transformation in `Lower`.
Aggelos Biboudis 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 fix-#8327683
- Merge branch 'master' into fix-#8327683
- 8327683: Crash with primitive type pattern and generic expression in instanceof
-------------
Changes:
- all: https://git.openjdk.org/jdk/pull/18168/files
- new: https://git.openjdk.org/jdk/pull/18168/files/d57b0456..e53bec1d
Webrevs:
- full: https://webrevs.openjdk.org/?repo=jdk&pr=18168&range=02
- incr: https://webrevs.openjdk.org/?repo=jdk&pr=18168&range=01-02
Stats: 302490 lines in 632 files changed: 11358 ins; 8478 del; 282654 mod
Patch: https://git.openjdk.org/jdk/pull/18168.diff
Fetch: git fetch https://git.openjdk.org/jdk.git pull/18168/head:pull/18168
PR: https://git.openjdk.org/jdk/pull/18168
From jlahoda at openjdk.org Tue Mar 19 09:38:26 2024
From: jlahoda at openjdk.org (Jan Lahoda)
Date: Tue, 19 Mar 2024 09:38:26 GMT
Subject: Integrated: 8325362: Allow to create a simple in-memory input
JavaFileObject
In-Reply-To: <6KbXE6d6CHtDEoQ03C66d8eFAUyoUM_WhFjJYQiQkqk=.10b93b93-ab06-4b31-bb70-c82eda99a8db@github.com>
References: <6KbXE6d6CHtDEoQ03C66d8eFAUyoUM_WhFjJYQiQkqk=.10b93b93-ab06-4b31-bb70-c82eda99a8db@github.com>
Message-ID:
On Thu, 7 Mar 2024 08:34:32 GMT, Jan Lahoda wrote:
> There are many subtypes of `SimpleJavaFileObject` scattered through various codebases, majority of them looking like:
>
>
> private static class JavaSource extends SimpleJavaFileObject {
>
> private String code;
>
> public JavaSource(String code) {
> super(URI.create("myfo:/Test.java"), JavaFileObject.Kind.SOURCE);
> this.code = code;
> }
>
> @Override
> public CharSequence getCharContent(boolean ignoreEncodingErrors) {
> return code;
> }
> }
>
>
> The proposal herein is a to add a factory method that would return an implementation of `SimpleJavaFileObject` based on the provided `URI` and source content.
>
> The CSR for this change is available for review here:
> https://bugs.openjdk.org/browse/JDK-8327536
This pull request has now been integrated.
Changeset: 5b6b5144
Author: Jan Lahoda
URL: https://git.openjdk.org/jdk/commit/5b6b514441fcbbaa210e2cad08ce2704fdf38191
Stats: 379 lines in 23 files changed: 183 ins; 111 del; 85 mod
8325362: Allow to create a simple in-memory input JavaFileObject
Reviewed-by: jlaskey, darcy
-------------
PR: https://git.openjdk.org/jdk/pull/18149
From weijun at openjdk.org Tue Mar 19 13:23:20 2024
From: weijun at openjdk.org (Weijun Wang)
Date: Tue, 19 Mar 2024 13:23:20 GMT
Subject: RFR: JDK-8328501 Incorrect @since tags for security java security
interfaces
In-Reply-To:
References:
Message-ID:
On Tue, 19 Mar 2024 11:15:56 GMT, Nizar Benalla wrote:
> The override of `getParams` in these interfaces was added in java 22 has an `@since 22`, but the method has been inherited to these interfaces for a long times,
> As pointed out by my mentor Jan,
>
>
> import javax.crypto.interfaces.DHPublicKey;
>
> public class DhkeyTest {
>
> public static void main(DHPublicKey key) {
> System.err.println(key.getParams());
> }
>
> }
>
>
> this compiles using JDK 8 without any compile-time errors. The @ since tag shouldn't be here
>
>
> - the same goes for these other interfaces
>
> java.security.interfaces.DSAPublicKey
> java.security.interfaces.XECPublicKey
> java.security.interfaces.DSAPrivateKey
> java.security.interfaces.ECPrivateKey
> java.security.interfaces.XECPrivateKey
> java.security.interfaces.EdECPrivateKey
> java.security.interfaces.ECPublicKey
> java.security.interfaces.EdECPublicKey
> javax.crypto.interfaces.DHPrivateKey
> javax.crypto.interfaces.DHPublicKey
>
> - these two should, have @ since 11 though
>
> java.security.interfaces.RSAPublicKey
> java.security.interfaces.RSAPrivateKey
I'd like to hear opinions from compiler experts.
-------------
PR Comment: https://git.openjdk.org/jdk/pull/18373#issuecomment-2007161883
From prappo at openjdk.org Tue Mar 19 15:25:26 2024
From: prappo at openjdk.org (Pavel Rappo)
Date: Tue, 19 Mar 2024 15:25:26 GMT
Subject: Integrated: 8297879: javadoc link to preview JEP 1000 has grouping
character comma
In-Reply-To: <1_igawz8T_HtBuu7XHnp5a7MdBKn1faVA5zBCr2T9bU=.dc2b11f7-84db-4db8-9752-9fd4eb4bd695@github.com>
References: <1_igawz8T_HtBuu7XHnp5a7MdBKn1faVA5zBCr2T9bU=.dc2b11f7-84db-4db8-9752-9fd4eb4bd695@github.com>
Message-ID: <7PArJXG1ZKRHbwf2SBnuB6z1YIOC9iYcMgHNX_MHmSI=.aa8998d0-08ec-44de-88e1-781df1a695ae@github.com>
On Mon, 18 Mar 2024 14:53:44 GMT, Pavel Rappo wrote:
> Please review this simple bugfix to properly construct links to preview JEPs.
>
> The most straightforward fix I could think of was to pass `String` rather than `int` (`Integer`) to a method, which eventually calls `java.text.MessageFormat.format(String, Object...)`.
>
> For the test, I decided to be ~lazy~ practical and piggyback on the existing infrastructure. The alternatives were:
>
> 1. slap `noreg-hard` on the JBS bug and skip testing
> 2. create a sophisticated test that dynamically adds a constant into the `PreviewFeature.Feature` enum, annotates some class with `PreviewFeature` with that constant, and finally documents that class with `PreviewFeature` patched into `java.base`
>
> While (1) is insufficient, (2) seems overkill in this case.
This pull request has now been integrated.
Changeset: f140eb4c
Author: Pavel Rappo
URL: https://git.openjdk.org/jdk/commit/f140eb4c3a47e1479d62fe1eef16bbbea92892bc
Stats: 5 lines in 3 files changed: 0 ins; 0 del; 5 mod
8297879: javadoc link to preview JEP 1000 has grouping character comma
Reviewed-by: jjg, vromero
-------------
PR: https://git.openjdk.org/jdk/pull/18350
From duke at openjdk.org Tue Mar 19 15:33:34 2024
From: duke at openjdk.org (Nizar Benalla)
Date: Tue, 19 Mar 2024 15:33:34 GMT
Subject: RFR: JDK-8328501 Incorrect @since tags for security java security
interfaces [v2]
In-Reply-To:
References:
Message-ID:
> For context, I am writing tests to check for accurate use of `@since` tags in documentation comments in source code.
> We're following these rules for now:
>
> if there's no `@since`:
>
> - for methods, look at the `@since` from the method from supertype this method overrides. If there's none from the overridden method, or if the `@since` in the enclosing class is newer that the one from the overridden method, use the `@since` from the enclosing element. Otherwise, use the `@since` from the overridden method.
> - otherwise, use the `@since` from the enclosing element.
>
> The override of `getParams` in these interfaces was done in in JDK 22 and an `@since 22` was, but this method has been inherited to these interfaces for a long time.
>
> As pointed out by my mentor Jan,
>
>
> import javax.crypto.interfaces.DHPublicKey;
>
> public class DhkeyTest {
>
> public static void main(DHPublicKey key) {
> System.err.println(key.getParams());
> }
>
> }
>
>
> this compiles using JDK 8 without any compile-time errors. The @ since tag shouldn't be here
>
>
> - the same goes for these other interfaces
>
> java.security.interfaces.DSAPublicKey
> java.security.interfaces.XECPublicKey
> java.security.interfaces.DSAPrivateKey
> java.security.interfaces.ECPrivateKey
> java.security.interfaces.XECPrivateKey
> java.security.interfaces.EdECPrivateKey
> java.security.interfaces.ECPublicKey
> java.security.interfaces.EdECPublicKey
> javax.crypto.interfaces.DHPrivateKey
> javax.crypto.interfaces.DHPublicKey
> java.security.interfaces.RSAPublicKey
> java.security.interfaces.RSAPrivateKey
Nizar Benalla has updated the pull request incrementally with one additional commit since the last revision:
remove since tags
-------------
Changes:
- all: https://git.openjdk.org/jdk/pull/18373/files
- new: https://git.openjdk.org/jdk/pull/18373/files/b5589e40..7ef8b4ee
Webrevs:
- full: https://webrevs.openjdk.org/?repo=jdk&pr=18373&range=01
- incr: https://webrevs.openjdk.org/?repo=jdk&pr=18373&range=00-01
Stats: 2 lines in 2 files changed: 0 ins; 2 del; 0 mod
Patch: https://git.openjdk.org/jdk/pull/18373.diff
Fetch: git fetch https://git.openjdk.org/jdk.git pull/18373/head:pull/18373
PR: https://git.openjdk.org/jdk/pull/18373
From cstein at openjdk.org Tue Mar 19 16:37:36 2024
From: cstein at openjdk.org (Christian Stein)
Date: Tue, 19 Mar 2024 16:37:36 GMT
Subject: RFR: JDK-8328339: Static import prevents source launcher from
finding class with main method [v3]
In-Reply-To:
References:
Message-ID:
> Please review this fix for finding the program class in case the first top-level type has no main method and the order of type compilation does not match the order in the source file - for example by a static import statement being present.
>
> Here's an excerpt from [JEP 458](https://openjdk.org/jeps/458#Launch-time-semantics-and-operation)'s "Launch-time semantics and operation" section describing the process:
>> 5. Determine the launch class of the initial .java file. If the first top level class in the initial file declares a standard main method (`public static void main(String[])` or other standard main entry points as defined in [JEP 463](https://openjdk.org/jeps/463#A-flexible-launch-protocol)), then that class is the launch class. Otherwise, if another top level class in the initial file declares a standard main method and has same name as the file, that class is the launch class. Otherwise, there is no launch class, and the launcher reports an error and stops.
Christian Stein has updated the pull request incrementally with three additional commits since the last revision:
- Update src/jdk.compiler/share/classes/com/sun/tools/javac/launcher/SourceLauncher.java
Co-authored-by: Jan Lahoda <51319204+lahodaj at users.noreply.github.com>
- Update src/jdk.compiler/share/classes/com/sun/tools/javac/launcher/ProgramDescriptor.java
Co-authored-by: Jan Lahoda <51319204+lahodaj at users.noreply.github.com>
- Update src/jdk.compiler/share/classes/com/sun/tools/javac/launcher/MemoryContext.java
Co-authored-by: Jan Lahoda <51319204+lahodaj at users.noreply.github.com>
-------------
Changes:
- all: https://git.openjdk.org/jdk/pull/18345/files
- new: https://git.openjdk.org/jdk/pull/18345/files/65fba8d6..47b851ab
Webrevs:
- full: https://webrevs.openjdk.org/?repo=jdk&pr=18345&range=02
- incr: https://webrevs.openjdk.org/?repo=jdk&pr=18345&range=01-02
Stats: 3 lines in 3 files changed: 0 ins; 0 del; 3 mod
Patch: https://git.openjdk.org/jdk/pull/18345.diff
Fetch: git fetch https://git.openjdk.org/jdk.git pull/18345/head:pull/18345
PR: https://git.openjdk.org/jdk/pull/18345
From cstein at openjdk.org Tue Mar 19 18:36:43 2024
From: cstein at openjdk.org (Christian Stein)
Date: Tue, 19 Mar 2024 18:36:43 GMT
Subject: RFR: JDK-8328339: Static import prevents source launcher from
finding class with main method [v4]
In-Reply-To:
References:
Message-ID: <_Ksqs4KcRiYEDbLqB3mN-SmQM2o3OyY_doJgIKE7QpM=.29ef03c7-d7b3-4fa8-8da2-8511b9a65a51@github.com>
> Please review this fix for finding the program class in case the first top-level type has no main method and the order of type compilation does not match the order in the source file - for example by a static import statement being present.
>
> Here's an excerpt from [JEP 458](https://openjdk.org/jeps/458#Launch-time-semantics-and-operation)'s "Launch-time semantics and operation" section describing the process:
>> 5. Determine the launch class of the initial .java file. If the first top level class in the initial file declares a standard main method (`public static void main(String[])` or other standard main entry points as defined in [JEP 463](https://openjdk.org/jeps/463#A-flexible-launch-protocol)), then that class is the launch class. Otherwise, if another top level class in the initial file declares a standard main method and has same name as the file, that class is the launch class. Otherwise, there is no launch class, and the launcher reports an error and stops.
Christian Stein has updated the pull request incrementally with one additional commit since the last revision:
Streamline program descriptor factory
-------------
Changes:
- all: https://git.openjdk.org/jdk/pull/18345/files
- new: https://git.openjdk.org/jdk/pull/18345/files/47b851ab..62209989
Webrevs:
- full: https://webrevs.openjdk.org/?repo=jdk&pr=18345&range=03
- incr: https://webrevs.openjdk.org/?repo=jdk&pr=18345&range=02-03
Stats: 23 lines in 2 files changed: 1 ins; 5 del; 17 mod
Patch: https://git.openjdk.org/jdk/pull/18345.diff
Fetch: git fetch https://git.openjdk.org/jdk.git pull/18345/head:pull/18345
PR: https://git.openjdk.org/jdk/pull/18345
From hgreule at openjdk.org Tue Mar 19 18:48:26 2024
From: hgreule at openjdk.org (Hannes Greule)
Date: Tue, 19 Mar 2024 18:48:26 GMT
Subject: RFR: 8328536: javac - crash on unknown type referenced in yield
statement
Message-ID:
Pasting e.g.
I m(I i, int x) {
return switch (x) {
default -> i;
};
}
in jshell will cause a crash if `I` is not declared already. This comes down to javac not creating an error type for the value of the (implicit) yield from the switch.
Javac will not crash but swallow the exception, and create a file containing the command line options.
I first thought about just checking for null of the type here https://github.com/openjdk/jdk/blob/9ca4ae3d3b746f1d75036d189ff98f02b73b948f/src/jdk.compiler/share/classes/com/sun/tools/javac/comp/Attr.java#L1640 but after a closer look, the `checkIdInternal` method seems a better fit, as it also updates the type normally.
-------------
Commit messages:
- Fix jshell crash on unknown type in switch yield
Changes: https://git.openjdk.org/jdk/pull/18383/files
Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=18383&range=00
Issue: https://bugs.openjdk.org/browse/JDK-8328536
Stats: 12 lines in 2 files changed: 11 ins; 0 del; 1 mod
Patch: https://git.openjdk.org/jdk/pull/18383.diff
Fetch: git fetch https://git.openjdk.org/jdk.git pull/18383/head:pull/18383
PR: https://git.openjdk.org/jdk/pull/18383
From vromero at openjdk.org Wed Mar 20 17:10:23 2024
From: vromero at openjdk.org (Vicente Romero)
Date: Wed, 20 Mar 2024 17:10:23 GMT
Subject: RFR: 8327683: Crash with primitive type pattern and generic
expression in instanceof [v3]
In-Reply-To:
References:
Message-ID:
On Tue, 19 Mar 2024 08:42:34 GMT, Aggelos Biboudis wrote:
>> When compiling the following code, javac results in `java.lang.AssertionError: T.intValue`:
>>
>>
>> public static boolean wideningReferenceConversionUnboxing(T i) {
>> return i instanceof int ii;
>> }
>>
>>
>> The translated code after `Lower`, results in a generated assignment `(int)i.intValue()`. The reason for this bug is that the variable `i` required to have the erased type, set. This PR addresses this issue in `TransPatterns`:
>>
>>
>> public static boolean wideningReferenceConversionUnboxing(Integer i) {
>> return (let int ii in
>> (let /*synthetic*/ final T tmp4500$ = i in tmp4500$ != null && (let /*synthetic*/ final T tmp4500$ = i in tmp4500$ != null)) &&
>> (let ii = (int)i.intValue(); in true));
>> }
>>
>>
>> We also observe a duplicated check in the generated code: `(let /*synthetic*/ final T tmp4500$ = i in tmp4500$ != null`. This PR also tidies up the relevant code transformation in `Lower`.
>
> Aggelos Biboudis 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 fix-#8327683
> - Merge branch 'master' into fix-#8327683
> - 8327683: Crash with primitive type pattern and generic expression in instanceof
looks sensible
-------------
Marked as reviewed by vromero (Reviewer).
PR Review: https://git.openjdk.org/jdk/pull/18168#pullrequestreview-1949546303
From acobbs at openjdk.org Thu Mar 21 02:20:49 2024
From: acobbs at openjdk.org (Archie Cobbs)
Date: Thu, 21 Mar 2024 02:20:49 GMT
Subject: RFR: 8328649: Disallow enclosing instances for local classes in
constructor prologues
Message-ID:
A local class declared in a static context is not supposed to have an immediately enclosing instance (?15.9.2). That includes local classes declared in constructors prior to `super()` (during the "constructor prologue" in the new lingo).
However, the compiler is allowing code like this to successfully compile:
import java.util.concurrent.atomic.*;
public class Test extends AtomicReference