Re: [jdk20] RFR: 8297288: Example code in Scanner class

2022-12-09 Thread Naoto Sato
On Fri, 9 Dec 2022 18:32:37 GMT, Naoto Sato wrote: > The example in `Scanner` directly uses `System.in` which may cause unwanted > behavior when the default charset and the console charset differ. Using > `Console.reader()` is more appropriate. Also changed examples into snippets. Yes. This

Re: [jdk20] RFR: 8297288: Example code in Scanner class

2022-12-09 Thread Jim Laskey
On Fri, 9 Dec 2022 18:32:37 GMT, Naoto Sato wrote: > The example in `Scanner` directly uses `System.in` which may cause unwanted > behavior when the default charset and the console charset differ. Using > `Console.reader()` is more appropriate. Also changed examples into snippets. You're

RFR: 8293667: Align jlink's --compress option with jmod's --compress option

2022-12-09 Thread Ian Graves
This is an approach to adding a flag to jlink that will allow --compress to take the same types of arguments as jmod, thus bringing the two into alignment. This likely requires a CSR and a discussion on whether we should deprecate or simply remove the original numeric compression arguments.

Re: [jdk20] RFR: 8297288: Example code in Scanner class

2022-12-09 Thread Brian Burkhalter
On Fri, 9 Dec 2022 18:32:37 GMT, Naoto Sato wrote: > The example in `Scanner` directly uses `System.in` which may cause unwanted > behavior when the default charset and the console charset differ. Using > `Console.reader()` is more appropriate. Also changed examples into snippets. Marked as

Re: [jdk20] RFR: 8297288: Example code in Scanner class

2022-12-09 Thread Lance Andersen
On Fri, 9 Dec 2022 18:32:37 GMT, Naoto Sato wrote: > The example in `Scanner` directly uses `System.in` which may cause unwanted > behavior when the default charset and the console charset differ. Using > `Console.reader()` is more appropriate. Also changed examples into snippets. Looks good

Re: [jdk20] RFR: 8297288: Example code in Scanner class

2022-12-09 Thread Naoto Sato
On Fri, 9 Dec 2022 18:32:37 GMT, Naoto Sato wrote: > The example in `Scanner` directly uses `System.in` which may cause unwanted > behavior when the default charset and the console charset differ. Using > `Console.reader()` is more appropriate. Also changed examples into snippets. Does it

Re: RFR: JDK-8298448: UndefinedBehaviorSanitizer

2022-12-09 Thread Erik Joelsson
On Fri, 9 Dec 2022 14:34:37 GMT, Erik Joelsson wrote: >> Allow building OpenJDK with UBSan. Currently the build fails when optimizing >> the image due to lots of undefined behavior (it invokes the built JVM). >> Follow up PRs will either replace the undefined behavior with well defined >>

Re: RFR: JDK-8298448: UndefinedBehaviorSanitizer

2022-12-09 Thread Erik Joelsson
On Fri, 9 Dec 2022 06:53:31 GMT, Justin King wrote: > Allow building OpenJDK with UBSan. Currently the build fails when optimizing > the image due to lots of undefined behavior (it invokes the built JVM). > Follow up PRs will either replace the undefined behavior with well defined > behavior

Re: [jdk20] RFR: 8297288: Example code in Scanner class

2022-12-09 Thread Jim Laskey
On Fri, 9 Dec 2022 18:32:37 GMT, Naoto Sato wrote: > The example in `Scanner` directly uses `System.in` which may cause unwanted > behavior when the default charset and the console charset differ. Using > `Console.reader()` is more appropriate. Also changed examples into snippets. CSR?

[jdk20] RFR: 8297288: Example code in Scanner class

2022-12-09 Thread Naoto Sato
The example in `Scanner` directly uses `System.in` which may cause unwanted behavior when the default charset and the console charset differ. Using `Console.reader()` is more appropriate. Also changed examples into snippets. - Commit messages: - 8297288: Example code in Scanner

Re: RFR: JDK-8298448: UndefinedBehaviorSanitizer

2022-12-09 Thread Andrew Haley
On Fri, 9 Dec 2022 06:53:31 GMT, Justin King wrote: > Allow building OpenJDK with UBSan. Currently the build fails when optimizing > the image due to lots of undefined behavior (it invokes the built JVM). > Follow up PRs will either replace the undefined behavior with well defined > behavior

Re: RFR: JDK-8298448: UndefinedBehaviorSanitizer

2022-12-09 Thread Andrew Haley
On Fri, 9 Dec 2022 14:16:19 GMT, Robbin Ehn wrote: > > What version of GCC are you using? > > gcc 11.3 with libubsan 11.2 > > Also it seem to big overlap with -Wcast-align(=strict) for the > warnings/errors I see and I do like that warning. Do you have an idea if the > coverage are pretty

Re: RFR: JDK-8298476: Unseal FinalReference

2022-12-09 Thread Alan Bateman
On Fri, 9 Dec 2022 14:17:24 GMT, Bernhard Urban-Forster wrote: > The change in [JDK-8283415](https://bugs.openjdk.org/browse/JDK-8283415) made > use of the now available `sealed` keyword for `FinalReference`. > > Unfortunately this introduced a problem for the Espresso VM (Java on >

Re: RFR: 8298380: Clean up redundant array length checks in JDK code base

2022-12-09 Thread Roger Riggs
On Thu, 8 Dec 2022 12:37:17 GMT, Sergey Tsypanov wrote: > Newer version of IntelliJ IDEA introduces new > [inspection](https://youtrack.jetbrains.com/issue/IDEA-301797/IDEA-should-report-redundant-array-length-check-in-certain-cases) > detecting redundant array length check in snippets like >

Re: RFR: 8298380: Clean up redundant array length checks in JDK code base

2022-12-09 Thread Sergey Tsypanov
On Fri, 9 Dec 2022 14:35:47 GMT, Roger Riggs wrote: >> Newer version of IntelliJ IDEA introduces new >> [inspection](https://youtrack.jetbrains.com/issue/IDEA-301797/IDEA-should-report-redundant-array-length-check-in-certain-cases) >> detecting redundant array length check in snippets like >>

Re: RFR: JDK-8298170 : Introduce a macro for exception check, free and return

2022-12-09 Thread Roger Riggs
On Fri, 9 Dec 2022 12:23:04 GMT, Matthias Baesken wrote: > Hi Roger , the new proposed version JNU_CHECK_EXCEPTION_DO is now almost as > lengthy as the original coding, Is it really worth it introducing a macro > when it gets so lengthy ? Its easier to understand the flow and cleanup being

Re: RFR: 8298380: Clean up redundant array length checks in JDK code base

2022-12-09 Thread Roger Riggs
On Thu, 8 Dec 2022 12:37:17 GMT, Sergey Tsypanov wrote: > Newer version of IntelliJ IDEA introduces new > [inspection](https://youtrack.jetbrains.com/issue/IDEA-301797/IDEA-should-report-redundant-array-length-check-in-certain-cases) > detecting redundant array length check in snippets like >

Re: RFR: JDK-8298448: UndefinedBehaviorSanitizer

2022-12-09 Thread Erik Joelsson
On Fri, 9 Dec 2022 06:53:31 GMT, Justin King wrote: > Allow building OpenJDK with UBSan. Currently the build fails when optimizing > the image due to lots of undefined behavior (it invokes the built JVM). > Follow up PRs will either replace the undefined behavior with well defined > behavior

RFR: JDK-8298476: Unseal FinalReference

2022-12-09 Thread Bernhard Urban-Forster
The change in [JDK-8283415](https://bugs.openjdk.org/browse/JDK-8283415) made use of the now available `sealed` keyword for `FinalReference`. Unfortunately this introduced a problem for the Espresso VM (Java on Truffle): Since Espresso is written in Java it uses the functionality of the "Host

Re: RFR: JDK-8298448: UndefinedBehaviorSanitizer

2022-12-09 Thread Robbin Ehn
On Fri, 9 Dec 2022 13:46:07 GMT, Justin King wrote: > What version of GCC are you using? gcc 11.3 with libubsan 11.2 Also it seem to big overlap with -Wcast-align(=strict) for the warnings/errors I see and I do like that warning. Do you have an idea if the coverage are pretty much the same

Re: RFR: JDK-8298448: UndefinedBehaviorSanitizer

2022-12-09 Thread Justin King
On Fri, 9 Dec 2022 06:53:31 GMT, Justin King wrote: > Allow building OpenJDK with UBSan. Currently the build fails when optimizing > the image due to lots of undefined behavior (it invokes the built JVM). > Follow up PRs will either replace the undefined behavior with well defined > behavior

Re: RFR: JDK-8298448: UndefinedBehaviorSanitizer

2022-12-09 Thread Robbin Ehn
On Fri, 9 Dec 2022 06:53:31 GMT, Justin King wrote: > Allow building OpenJDK with UBSan. Currently the build fails when optimizing > the image due to lots of undefined behavior (it invokes the built JVM). > Follow up PRs will either replace the undefined behavior with well defined > behavior

Integrated: 8298380: Clean up redundant array length checks in JDK code base

2022-12-09 Thread Sergey Tsypanov
On Thu, 8 Dec 2022 12:37:17 GMT, Sergey Tsypanov wrote: > Newer version of IntelliJ IDEA introduces new > [inspection](https://youtrack.jetbrains.com/issue/IDEA-301797/IDEA-should-report-redundant-array-length-check-in-certain-cases) > detecting redundant array length check in snippets like >

Re: RFR: JDK-8298170 : Introduce a macro for exception check, free and return

2022-12-09 Thread Matthias Baesken
On Tue, 6 Dec 2022 15:20:26 GMT, Matthias Baesken wrote: > We have a number of places in the codebase where a macro could help when we > check an exception and afterwrads free something and return. Hi Roger , the new proposed version JNU_CHECK_EXCEPTION_DO is now almost as lengthy as the