Skip to content
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

8247403: JShell: No custom input (e.g. from GUI) possible with JavaShellToolBuilder #2509

Closed
wants to merge 9 commits into from

Conversation

lahodaj
Copy link
Contributor

@lahodaj lahodaj commented Feb 10, 2021

Basically, JShell's ConsoleIOContext always uses the JLine's default terminal, which uses System.in, or equivalent, for input. But, if the JShell tool has been created using JavaShellToolBuilder, a different input might have been provided. The proposed solution is to use a different JLine's terminal in this case, based on the provided input.


Progress

  • Change must not contain extraneous whitespace
  • Commit message must refer to an issue
  • Change must be properly reviewed

Issue

  • JDK-8247403: JShell: No custom input (e.g. from GUI) possible with JavaShellToolBuilder

Reviewers

Reviewing

Using git

Checkout this PR locally:
$ git fetch https://git.openjdk.java.net/jdk pull/2509/head:pull/2509
$ git checkout pull/2509

Update a local copy of the PR:
$ git checkout pull/2509
$ git pull https://git.openjdk.java.net/jdk pull/2509/head

Using Skara CLI tools

Checkout this PR locally:
$ git pr checkout 2509

View PR using the GUI difftool:
$ git pr show -t 2509

Using diff file

Download this PR as a diff file:
https://git.openjdk.java.net/jdk/pull/2509.diff

@bridgekeeper
Copy link

bridgekeeper bot commented Feb 10, 2021

👋 Welcome back jlahoda! A progress list of the required criteria for merging this PR into master will be added to the body of your pull request. There are additional pull request commands available for use with this pull request.

@openjdk openjdk bot added the rfr Pull request is ready for review label Feb 10, 2021
@openjdk
Copy link

openjdk bot commented Feb 10, 2021

@lahodaj The following label will be automatically applied to this pull request:

  • kulla

When this pull request is ready to be reviewed, an "RFR" email will be sent to the corresponding mailing list. If you would like to change these labels, use the /label pull request command.

@openjdk openjdk bot added the kulla kulla-dev@openjdk.org label Feb 10, 2021
@mlbridge
Copy link

mlbridge bot commented Feb 10, 2021

Webrevs

Copy link
Contributor

@vicente-romero-oracle vicente-romero-oracle left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@openjdk
Copy link

openjdk bot commented Apr 12, 2021

@lahodaj This change now passes all automated pre-integration checks.

ℹ️ This project also has non-automated pre-integration requirements. Please see the file CONTRIBUTING.md for details.

After integration, the commit message for the final commit will be:

8247403: JShell: No custom input (e.g. from GUI) possible with JavaShellToolBuilder

Reviewed-by: vromero

You can use pull request commands such as /summary, /contributor and /issue to adjust it as needed.

At the time when this comment was updated there had been 676 new commits pushed to the master branch:

  • ac36b7d: 8267452: Delegate forEachRemaining in Spliterators.iterator()
  • d0d2ddc: 8267651: runtime/handshake/HandshakeTimeoutTest.java times out when dumping core
  • a98e476: 8267311: vmTestbase/gc/gctests/StringInternGC/StringInternGC.java eventually OOMEs
  • 5aa45f2: 8267403: tools/jpackage/share/FileAssociationsTest.java#id0 failed with "Error: Bundler "Mac PKG Package" (pkg) failed to produce a package"
  • c20ca42: 8267691: Change table to obsolete CriticalJNINatives in JDK 18, not 17
  • e751b7b: 8267683: rfc7301Grease8F value not displayed correctly in SSLParameters javadoc
  • 0b77359: 8224243: Add implSpec's to AccessibleObject and seal Executable
  • 594d454: 8267574: Dead code in HtmlStyle/HtmlDocletWriter
  • 2ef2450: 8263445: Duplicate key compiler.err.expected.module in compiler.properties
  • cc687fd: 8267575: Add new documentation group in HtmlStyle
  • ... and 666 more: https://git.openjdk.java.net/jdk/compare/e2106d5af6244a9394be10106619ea5ac3262a9a...master

As there are no conflicts, your changes will automatically be rebased on top of these commits when integrating. If you prefer to avoid this automatic rebasing, please check the documentation for the /integrate command for further details.

➡️ To integrate this PR with the above commit message to the master branch, type /integrate in a new comment.

@openjdk openjdk bot added the ready Pull request is ready to be integrated label Apr 12, 2021
@lahodaj
Copy link
Contributor Author

lahodaj commented Apr 26, 2021

It turned out some users/clients of JavaShellToolBuilder do not attach a full terminal to it, but rather parse the output, and since we have changed the output by using a newer JLine, this became more complicated. So the new iteration of the patch supports two modes: a (default) simpler mode, which does not use escape sequences much, and a more for real terminals, where JShell will use escape sequences to provide a good experiment to a user reading on the terminal. Please also see the associated CSR:
https://bugs.openjdk.java.net/browse/JDK-8265966

@vicente-romero-oracle
Copy link
Contributor

/csr

@openjdk openjdk bot added the csr Pull request needs approved CSR before integration label May 21, 2021
@openjdk
Copy link

openjdk bot commented May 21, 2021

@vicente-romero-oracle this pull request will not be integrated until the CSR request JDK-8265966 for issue JDK-8247403 has been approved.

@openjdk openjdk bot removed the ready Pull request is ready to be integrated label May 21, 2021
@vicente-romero-oracle
Copy link
Contributor

vicente-romero-oracle commented May 21, 2021

in the CSR and in the new method spec, please consider adding in the @implSpec section a mention to that the provided default implementation does something in the lines of:

The default implementation of this method returns {@code this}.

apart from this I think the patch is good to go

@openjdk openjdk bot added ready Pull request is ready to be integrated and removed csr Pull request needs approved CSR before integration labels May 26, 2021
@lahodaj
Copy link
Contributor Author

lahodaj commented May 31, 2021

/integrate

@openjdk openjdk bot closed this May 31, 2021
@openjdk openjdk bot added integrated Pull request has been integrated and removed ready Pull request is ready to be integrated labels May 31, 2021
@openjdk openjdk bot removed the rfr Pull request is ready for review label May 31, 2021
@openjdk
Copy link

openjdk bot commented May 31, 2021

@lahodaj Since your change was applied there have been 728 commits pushed to the master branch:

Your commit was automatically rebased without conflicts.

Pushed as commit 2c8e94f.

💡 You may see a message that your pull request was closed with unmerged commits. This can be safely ignored.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
integrated Pull request has been integrated kulla kulla-dev@openjdk.org
2 participants