[jdk17u-dev] RFR: 8327476: Upgrade JLine to 3.26.1 [v2]
Goetz Lindenmaier
goetz at openjdk.org
Tue Feb 25 16:14:01 UTC 2025
On Mon, 24 Feb 2025 11:55:32 GMT, Goetz Lindenmaier <goetz at openjdk.org> wrote:
>> 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
>>...
>
> Goetz Lindenmaier has updated the pull request incrementally with one additional commit since the last revision:
>
> Fix test that fails in agentvm mode (-avm)
Thanks for reviewing!
-------------
PR Comment: https://git.openjdk.org/jdk17u-dev/pull/3292#issuecomment-2682528957
More information about the jdk-updates-dev
mailing list