On Thu, 7 Mar 2024 12:11:19 GMT, ExE Boss <d...@openjdk.org> wrote: >> This is a patch that: >> a) upgrades the JLine inside the JDK to 3.25.1 >> b) since the new version of JLine has a FFM backend, our custom native >> backends are removed, and replaced with the FFM backend >> >> Some changes had to be made to the original JLine in order to fit into the >> JDK. Most of them were already done for the previous version (repackaging, >> avoiding non-ASCII characters, commenting out logging, adding ability to >> modify to wrap the InputStream used by the terminal), and have only been >> transferred to the new one. The main two new changes are: >> - fixes to the FFM backend, so that it works on Linux and JDK 22. These have >> been proposed to JLine itself: https://github.com/jline/jline3/pull/945 >> - disabling the `NativeFileDescriptorCreator`, as I believe we don't need >> it, and cannot make it work easily >> >> There's a full patch between the >> `src/jdk.internal.le/share/classes/jdk/internal/org` and the merged content >> of the corresponding sources of these original JLine sub-projects: >> https://github.com/jline/jline3/tree/jline-parent-3.25.1/reader >> https://github.com/jline/jline3/tree/jline-parent-3.25.1/terminal-ffm >> https://github.com/jline/jline3/tree/jline-parent-3.25.1/terminal >> the patch is here: >> https://cr.openjdk.org/~jlahoda/8327476/jline-3.25.1-upgrade.diff >> >> I've also cleaned the patch a little removing most of the changes for the >> rename. The result is here: >> https://cr.openjdk.org/~jlahoda/8327476/jline-3.25.1-upgrade-significant.diff > > src/jdk.internal.le/share/classes/jdk/internal/org/jline/terminal/impl/AbstractPty.java > line 214: > >> 212: return descriptor; >> 213: } >> 214: } > > Since this is a part of the JDK, > `jdk.internal.access.JavaIOFileDescriptorAccess` can be used instead of > reflection.
As this originates in the JLine itself, I would rather avoid doing changes that are unnecessary. Because as a consequence, we would need to re-apply the changes for every upgrade. I believe this code is practically not used in our context, so I don't think it really matters to make it nice. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/18142#discussion_r1516856805