[jdk17u-dev] RFR: 8327476: Upgrade JLine to 3.26.1 [v2]

Goetz Lindenmaier goetz at openjdk.org
Mon Feb 24 11:55:32 UTC 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](https://bugs.openjdk.org/browse/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](https://bugs.openjdk.org/browse/JDK-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](https://bugs.openjdk.org/browse/JDK-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...

Goetz Lindenmaier has updated the pull request incrementally with one additional commit since the last revision:

  Fix test that fails in agentvm mode (-avm)

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

Changes:
  - all: https://git.openjdk.org/jdk17u-dev/pull/3292/files
  - new: https://git.openjdk.org/jdk17u-dev/pull/3292/files/7eebf01e..7f8f177a

Webrevs:
 - full: https://webrevs.openjdk.org/?repo=jdk17u-dev&pr=3292&range=01
 - incr: https://webrevs.openjdk.org/?repo=jdk17u-dev&pr=3292&range=00-01

  Stats: 2 lines in 1 file changed: 0 ins; 1 del; 1 mod
  Patch: https://git.openjdk.org/jdk17u-dev/pull/3292.diff
  Fetch: git fetch https://git.openjdk.org/jdk17u-dev.git pull/3292/head:pull/3292

PR: https://git.openjdk.org/jdk17u-dev/pull/3292


More information about the jdk-updates-dev mailing list