This upgrades the JLine embedded in the JDK to JLine 4.0.12.

The upgrade as such was not very difficult, but for historical reasons was done 
in two steps: I first upgraded to 4.0.9 using a usual process of taking a diff 
between existing master and the corresponding JLine (3.29.0 in this case), then 
replacing it with unmodified new version of JLine and re-applying the patch. 
The I upgraded from 4.0.9 to 4.0.12 by applying just the relevant differences 
between these two versions.

Other important notes:
- I had to manually disable running of infocmp: 
https://github.com/lahodaj/jdk/blob/1455a3279f9261ca9ee8590172b1e4d1fc5e35ca/src/jdk.internal.le/share/classes/jdk/internal/org/jline/utils/InfoCmp.java#L606
 ; `jdk.internal.le` will implicitly now fallback on `ansi` if it does not 
recognize the terminal.
- when reading a password on a dumb terminal, the new JLine uses a background 
thread to remove the password from the terminal. To keep tests stable and 
predictable, I had to add a way to disable this, see: 
https://github.com/lahodaj/jdk/blob/1455a3279f9261ca9ee8590172b1e4d1fc5e35ca/src/jdk.internal.le/share/classes/jdk/internal/org/jline/reader/impl/LineReaderImpl.java#L95
 and the usages.
- the new JLine has some support for graphics on the terminal, but that 
requires a dependency on `java.desktop`, and we don't have a use for it at this 
time. And the graphics support is fairly standalone, can be 
avoided/not-included. So this upgrade is not including this graphics support.

To potentially help with the review, this is the patch between JLine 3.29.0 and 
master:
https://cr.openjdk.org/~jlahoda/8381868/jline-patch-3.29.0-2.diff

this is the patch between JLine 4.0.12 and the code proposed in this PR:
https://cr.openjdk.org/~jlahoda/8381868/jline-patch-4.0.12.diff

and this is a meta-diff between these two diffs:
https://cr.openjdk.org/~jlahoda/8381868/diff-of-diffs-3.29.0-4.0.12.diff

the meta diff is not straightforward to read, but I went through it, and it 
seems OK to me.

---------
- [x] I confirm that I make this contribution in accordance with the [OpenJDK 
Interim AI Policy](https://openjdk.org/legal/ai).

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

Commit messages:
 - Do not fall back to dumb, throw the exception, and let the caller do the 
fallback (caller will fall back to ansi).
 - Correcting package clauses.
 - Fixing tests.
 - Update to JLine 4.0.12
 - Dropping TerminalGraphics for now, we don't have a clear use for it right 
now anyway.
 - Upgrade JLine to 4.0.9

Changes: https://git.openjdk.org/jdk/pull/30767/files
  Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=30767&range=00
  Issue: https://bugs.openjdk.org/browse/JDK-8381868
  Stats: 14705 lines in 129 files changed: 13297 ins; 405 del; 1003 mod
  Patch: https://git.openjdk.org/jdk/pull/30767.diff
  Fetch: git fetch https://git.openjdk.org/jdk.git pull/30767/head:pull/30767

PR: https://git.openjdk.org/jdk/pull/30767

Reply via email to