-
Notifications
You must be signed in to change notification settings - Fork 6.1k
8361972: Clarify the condition of System.console() about standard input/output #26299
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Changes from 2 commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||
---|---|---|---|---|
|
@@ -45,8 +45,10 @@ | |||
* output streams then its console will exist and will typically be | ||||
* connected to the keyboard and display from which the virtual machine | ||||
* was launched. If the virtual machine is started automatically, for | ||||
* example by a background job scheduler, then it may not | ||||
* have a console. | ||||
* example by a background job scheduler, then it may not have a | ||||
* console. Regardless of how the virtual machine was created, it may not | ||||
* have a console if either the standard input or output stream is | ||||
* redirected. | ||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Can you clarify what the intent of "it may not have a console" is? Initially I though the intention was that there is no Console when either stdout or stdin is redirected. However, the sentence suggests there may or may not be a Console. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I was considering the case for
That led me to use There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Since the decision of whether a console exists is dependent on the implementation as specified,
And the existing wording in this paragraph uses open-ended words such as "may" and "typically", it makes sense to me that this change would follow the same style of wording. If you wanted to concretely define what this implementation does, using one of the There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Okay, so the intent is to specify that it is implementation or configuration specific as to whether there is a Console when standard input or output, but not both, are redirected, is that right? What should users expect isTerminal to return in this case? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. For the jshell case, I think it can return |
||||
* <p> | ||||
* If this virtual machine has a console then it is represented by a | ||||
* unique instance of this class which can be obtained by invoking the | ||||
|
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it might read easier if we reword the structure of the sentence to make it more concise.
E.g.