Skip to content

Conversation

@GoeLin
Copy link
Member

@GoeLin GoeLin commented Feb 22, 2025

I backport this change for parity with 17.0.15-oracle.

It brings updates of upstream library jline 3.26.1 to jdk17.
Jdk17 currently includes jline 3.22.0, see JDK-8297587.
The original sources of jline 3.26.1 can be found here:
https://github.com/jline/jline3/archive/refs/tags/jline-parent-3.26.1.tar.gz

The backport of this change needed some adaptions.

The original jline library dynamically selects how to access
the operating system in two means:

Which operating system? linux, windows, mac?
JDK functionality to do native calls: JNI, jna, ffm?

The implementation in OpenJDK does this selection at JDK build time.
The code is split into more subdirectories for the operating systems.
One of the methods to call native is picked, the code for the others
is removed. Unfortunately this differs for the JDK releases:

jdk23 uses ffm.
jdk21 uses jna.
jdk17 uses jna on windows, "exec" on the remaining OSes.

"8306983: Do not invoke external programs when switch terminal to raw mode on selected platforms"
implemented the jna access for unix etc. in 21.

Because of these differences I had to adapt the change when
backporting from 23 to 21, and now I need to do so again.

I am basing my backport to 17 on the commit of this change in 21.

First, I just drop the changes to the files not in 17 that were added by 8306983:

aix/classes/jdk/internal/org/jline/terminal/impl/jna/JDKNativePty.java
linux/classes/jdk/internal/org/jline/terminal/impl/jna/JDKNativePty.java
linux/classes/jdk/internal/org/jline/terminal/impl/jna/linux/CLibrary.java
linux/classes/jdk/internal/org/jline/terminal/impl/jna/linux/LinuxNativePty.java
macosx/classes/jdk/internal/org/jline/terminal/impl/jna/JDKNativePty.java
macosx/classes/jdk/internal/org/jline/terminal/impl/jna/osx/CLibrary.java
macosx/classes/jdk/internal/org/jline/terminal/impl/jna/osx/OsXNativePty.java
unix/classes/jdk/internal/org/jline/terminal/impl/jna/JnaNativePty.java
unix/classes/jdk/internal/org/jline/terminal/impl/jna/JnaTerminalProvider.java

The remaining patch applied quite well, I only had to
resolve the following files:

src/jdk.internal.le/share/classes/jdk/internal/org/jline/reader/Buffer.java
src/jdk.internal.le/share/classes/jdk/internal/org/jline/reader/LineReader.java
src/jdk.internal.le/share/classes/jdk/internal/org/jline/reader/impl/BufferImpl.java
src/jdk.internal.le/share/classes/jdk/internal/org/jline/reader/impl/LineReaderImpl.java

Code that was added by "8321131: Console read line with zero out should zero out underlying buffer in JLine" or
"8321409: Console read line with zero out should zero out underlying buffer in JLine (redux)" is modified.
The two changes were not backported to 17, as JdkConsoleProviderImpl.java
which was added by "8295803: Console should be usable in jshell and other environments",
is not in 17. But now these JDK specific extensions have been added upstream.
So I add them to 17, too, to reduce differences.

src/jdk.internal.le/share/classes/jdk/internal/org/jline/terminal/impl/AbstractTerminal.java
Trivial resolve.

src/jdk.internal.le/windows/classes/jdk/internal/org/jline/terminal/impl/jna/win/JnaWinConsoleWriter.java
Trivial resolve of imports.
src/jdk.internal.le/windows/classes/jdk/internal/org/jline/terminal/impl/jna/win/JnaWinSysTerminal.java
Trivial resolves of imports and the rest of the chunk with the imports.

The only difference in these two files to jdk21 is the import of LastErrorException.

To make it compile, I needed to add import "Arrays"
to BufferImpl.java. See small extra commit.


Progress

  • Change must be properly reviewed (1 review required, with at least 1 Reviewer)
  • Change must not contain extraneous whitespace
  • Commit message must refer to an issue
  • JDK-8327476 needs maintainer approval

Issue

  • JDK-8327476: Upgrade JLine to 3.26.1 (Task - P4 - Approved)

Reviewers

Reviewing

Using git

Checkout this PR locally:
$ git fetch https://git.openjdk.org/jdk17u-dev.git pull/3292/head:pull/3292
$ git checkout pull/3292

Update a local copy of the PR:
$ git checkout pull/3292
$ git pull https://git.openjdk.org/jdk17u-dev.git pull/3292/head

Using Skara CLI tools

Checkout this PR locally:
$ git pr checkout 3292

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

Using diff file

Download this PR as a diff file:
https://git.openjdk.org/jdk17u-dev/pull/3292.diff

Using Webrev

Link to Webrev Comment

@bridgekeeper
Copy link

bridgekeeper bot commented Feb 22, 2025

👋 Welcome back goetz! 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
Copy link

openjdk bot commented Feb 22, 2025

@GoeLin 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:

8327476: Upgrade JLine to 3.26.1

Reviewed-by: mdoerr

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 1 new commit pushed to the master branch:

  • 01d107a: 8339728: [Accessibility,Windows,JAWS] Bug in the getKeyChar method of the AccessBridge class

Please see this link for an up-to-date comparison between the source branch of this pull request and the master branch.
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.

@GoeLin GoeLin changed the title Goetz backport 8327476 Backport d02ad34144917a36911296b20ce28381ead3f601 Feb 24, 2025
@openjdk openjdk bot changed the title Backport d02ad34144917a36911296b20ce28381ead3f601 8327476: Upgrade JLine to 3.26.1 Feb 24, 2025
@openjdk
Copy link

openjdk bot commented Feb 24, 2025

This backport pull request has now been updated with issue from the original commit.

@openjdk openjdk bot added backport Port of a pull request already in a different code base rfr Pull request is ready for review labels Feb 24, 2025
@mlbridge
Copy link

mlbridge bot commented Feb 24, 2025

Webrevs

Copy link
Contributor

@TheRealMDoerr TheRealMDoerr left a comment

Choose a reason for hiding this comment

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

Your modifications look reasonable.

@openjdk
Copy link

openjdk bot commented Feb 24, 2025

⚠️ @GoeLin This change is now ready for you to apply for maintainer approval. This can be done directly in each associated issue or by using the /approval command.

@openjdk openjdk bot added approval Requires approval; will be removed when approval is received ready Pull request is ready to be integrated and removed approval Requires approval; will be removed when approval is received labels Feb 25, 2025
@GoeLin
Copy link
Member Author

GoeLin commented Feb 25, 2025

Thanks for reviewing!

@GoeLin
Copy link
Member Author

GoeLin commented Feb 25, 2025

/integrate

@openjdk
Copy link

openjdk bot commented Feb 25, 2025

Going to push as commit bb391d7.
Since your change was applied there have been 2 commits pushed to the master branch:

  • fbf5ebe: 8198666: Many java/awt/Modal/OnTop/ test fails on mac
  • 01d107a: 8339728: [Accessibility,Windows,JAWS] Bug in the getKeyChar method of the AccessBridge class

Your commit was automatically rebased without conflicts.

@openjdk openjdk bot added the integrated Pull request has been integrated label Feb 25, 2025
@openjdk openjdk bot closed this Feb 25, 2025
@openjdk openjdk bot removed ready Pull request is ready to be integrated rfr Pull request is ready for review labels Feb 25, 2025
@openjdk
Copy link

openjdk bot commented Feb 25, 2025

@GoeLin Pushed as commit bb391d7.

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

@GoeLin GoeLin deleted the goetz_backport_8327476 branch February 25, 2025 16:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backport Port of a pull request already in a different code base integrated Pull request has been integrated

Development

Successfully merging this pull request may close these issues.

2 participants