RFR: JDK-8080679: Include jline in JDK for Java and JavaScript REPLs
Jan Lahoda
jan.lahoda at oracle.com
Tue Jun 30 15:05:58 UTC 2015
On 30.6.2015 16:27, Alan Bateman wrote:
>
>
> On 30/06/2015 14:54, Jan Lahoda wrote:
>>
>> I've changed the registration to use a Callable to produce the
>> Terminal instances instead of registering the Terminal classes:
>> http://cr.openjdk.java.net/~jlahoda/8080679/webrev.05/full/
>> delta:
>> http://cr.openjdk.java.net/~jlahoda/8080679/webrev.05/delta/
>>
>> (I used Callable rather than Supplier, as Callable allows to throw an
>> exception from the call method.)
>>
>> How does this look?
> WindowsTerminal.* looks good now. It's a pity we can't make proper use
> of the source code layout and move WindowsTerminal.java to
> windows/classes/jdk/internal/jline, same thing for UnixTerminal to
> unix/classes/... I would if the upstream project would be open to
> restructuring this as services and ServiceLoader?
We need to override these "settings" for jshell (we use subclasses of
WindowsTerminal/UnixTerminal to get e.g. Ctrl-C detection - not sure if
we will want to generalize these additional features for jjs as well).
Is there a way to override them (just) for jshell using ServiceLoader?
Jan
>
> Using the method references to make the initialization lazy looks okay.
> Remi's suggest to use getOrDefault makes it a bit nicer.
>
> -Alan.
More information about the core-libs-dev
mailing list