RFR: 8332084: Ensure JdkConsoleImpl.restoreEcho visibility in a shutdown hook

ExE Boss duke at openjdk.org
Sat May 11 06:35:02 UTC 2024


On Fri, 10 May 2024 21:55:26 GMT, Naoto Sato <naoto at openjdk.org> wrote:

> Making sure `restoreEcho` correctly reflects the state in the shutdown thread, which differs from the application's thread that issues the `readPassword()` method.

src/java.base/share/classes/jdk/internal/io/JdkConsoleImpl.java line 160:

> 158:                                 }
> 159:                             });
> 160:         } catch (IllegalStateException e) {

For consistency, this can also use `_`:
Suggestion:

        } catch (IllegalStateException _) {

-------------

PR Review Comment: https://git.openjdk.org/jdk/pull/19184#discussion_r1597369939


More information about the core-libs-dev mailing list