Naoto Sato
Naoto Sato
btw, the link to getBundle javadoc points to JDK8's, where the module has not yet been introduced. I was scratching my head why I couldn't find the overload that takes...
Thanks, Pavel. > While it's hard to test this change (hence the `noreg-hard` label), the `restoreEcho` functionality does not seem to be tested at all. Should we add a straightforward...
Right, making the field volatile is a much safer solution.
I thought of the same scenario that is certainly possible. Now I am tempted to avoid this race condition altogether by removing checking restoreEcho and always issue echo(true). What do...
OK, I realized removing checking `restoreEcho` does not work, here is why. > It should be possible to provide something adequate based on atomic primitives. However, it would complicate code....
Thanks, Stuart. The shutdown hook in question is in the `java.base`'s JdkConsole implementation, so the save/restore responsibility is already pushed down to each provider. Thinking that `java.base`'s implementation is now...
Based on an internal discussion regarding Stuart's above comment, I changed the `restoreEcho` field back to the original. Instead of making it volatile, synchronizing it with a dedicated lock would...
Hi Pavel, > If I read [this](https://docs.oracle.com/en/java/javase/22/docs/api/java.base/java/lang/Runtime.html#shutdown) correctly, due to the mechanics of JVM exit, we simply don't know which thread finishes first: a thread that calls `readPassword` or the...