RFR 8167636: jshell tool: Edit Pad should be in its own module
Remi Forax
forax at univ-mlv.fr
Sun Oct 23 07:47:02 UTC 2016
Hi Robert,
in ConsoleIOContext, the private bind() can take a Consumer (or a Runnable) as second parameter so you don't need to use a special functional interface for that (ActionListener).
BuildInEditorProvider should be an interface, the only reason to not use an interface as a module service is backward compatibility.
In jdk.shell module, i don't know why you restrict the access to jdk.internal.jshell.editpad. If someone want it's own editor, why not letting him to implement BuildInEditorProvider.
EditPane do not need to be a JFrame (i.e. inherits from a JFrame), you can create a plain old JFrame in run().
Also the CountDownLatch::countDown can be shield behind a Runnable so only EditPadProvider knows that it uses a CountDownLatch, the EditPane will only call the Runnable.
cheers,
Rémi
----- Mail original -----
> De: "Robert Field" <robert.field at oracle.com>
> À: "Kulla" <kulla-dev at openjdk.java.net>
> Envoyé: Dimanche 23 Octobre 2016 08:52:28
> Objet: Re: RFR 8167636: jshell tool: Edit Pad should be in its own module
> Note: jdk.internal.le and thus the jshell tool's ConsoleIOContext have a
> dependency on java.awt.event.ActionListener.
> The former uses reflection to quietly ignore when it isn't present -- at
> a loss of functionality (functionality we use).
> This code has a hack until I can discuss with Jan what the options are.
> Ideally jdk.internal.le can lose it's dependency; Otherwise, I will
> change ConsoleIOContext to use reflection, which will mean a loss of
> shift-tab and shortcut+* functionality when java.desktop is not in the
> image.
>
> -Robert
>
>
> On 10/22/16 21:14, Robert Field wrote:
>> Remove the dependency of the jshell tool on the java.desktop module.
>> Uses modules and ServiceLoader so that Edit Pad is optional -- that
>> is, a jlink'ed image can be produced without Edit Pad and without
>> java.desktop
>>
>> Bug:
>> https://bugs.openjdk.java.net/browse/JDK-8167636
>>
>> Webrev:
>> http://cr.openjdk.java.net/~rfield/8167636v0.webrev/
>>
>> Thanks,
>> Robert
More information about the kulla-dev
mailing list