RFR 8177076: jshell tool: allow non-zero /exit

Robert Field robert.field at oracle.com
Wed Nov 1 17:56:43 UTC 2017


On 11/01/17 10:49, Christian Stein wrote:
> Hi Robert,
>
> I'm looking forward to /exit with some code other than zero.
> Allowing a snippet that evaluates to an integer is more than expected.
> Great!

:-)

>
> The initial "snippet-less" /exit always returns zero -- this is not (yet)
> documented in the long help text, as far as I can see.
>
> ! Save any work before using this command\n\! \n\! /exit\n\t\!
> Leave the jshell tool\n\n\

Good point, will fix.

Thanks,
Robert

>
> Cheers,
> Christian
>
> On Wed, Nov 1, 2017 at 6:35 PM, Robert Field <robert.field at oracle.com>
> wrote:
>
>> A minor update with improvements I was mulling over while I should have
>> been sleeping:
>>
>>      http://cr.openjdk.java.net/~rfield/8185840v1.webrev/
>>
>> -Robert
>>
>> On 10/31/17 22:26, Robert Field wrote:
>>
>>> The seed of this is the ability to exit the jshell tool with a user
>>> specified exit code.  For example:
>>>
>>>      /exit result > base ? 0 : 7
>>>
>>> However, this requires the tool launching API to support passing on the
>>> exit code.
>>> In turn, this requires the tool to return exit codes, and do so correctly
>>> for tool errors.
>>>
>>> This is the first case of a command taking a snippet as an argument.
>>> Input continuation was tied to snippet input processing.
>>> Input, continuation, command, and snippet processing needed to be
>>> unraveled.
>>>
>>> Diagnostic display, formerly only needed for snippets, needed to be
>>> refactored.
>>>
>>> Tab completion needed to be handled in this new case (note integer
>>> context).
>>>
>>> On testing side, StartOptionTest and its subclass ToolProviderTest were a
>>> teetering pile of spaghetti that were not amenable to
>>> the additional demands of the new needed tests.  They have been revamped.
>>>
>>> Bugs:
>>>
>>>      8177076: jshell tool: allow non-zero /exit
>>>      https://bugs.openjdk.java.net/browse/JDK-8185840
>>>
>>>      8190383: JShell API: no way for the jshell tool to report exit status
>>> to provider
>>>      https://bugs.openjdk.java.net/browse/JDK-8190383
>>>
>>> Webrev:
>>>
>>>      http://cr.openjdk.java.net/~rfield/8185840v0.webrev/
>>>
>>> Thanks,
>>> Robert
>>>
>>>



More information about the kulla-dev mailing list