JShell.setIdGenerator/setTempVariableNameGenerator

Robert Field robert.field at oracle.com
Thu Jul 23 04:31:47 UTC 2015


On 07/22/15 01:25, Paul Sandoz wrote:
> Hi Robert,
>
> Do you consider that the generator functions should be provided to the JShell factory method? or would there be a need to override during a shell session?
>
> Perhaps a builder API is required? that would be a reasonable way to hide these advanced methods as developers will never notice for the common case of default construction, and it would allow for other configuration (if any is required).
>
> Paul.

I've switched to a Builder pattern.  Looks clean in practice (JShell 
tool, examples, and tests)..

Didn't do Brian's suggestion of moving event registration into the 
builder yet -- waiting on answer to my concerns.

-Robert

>
> On 22 Jul 2015, at 07:51, robert.field at oracle.com wrote:
>
>> Changeset: 63ea362884ae
>> Author:    rfield
>> Date:      2015-07-21 22:51 -0700
>> URL:       http://hg.openjdk.java.net/kulla/dev/langtools/rev/63ea362884ae
>>
>> 8130453: JShell API: add setIdGenerator and setTempVariableNameGenerator
>> 8130452: JShell tool: create tool-ids for snippets with keyspaces for start-up, normal, and errors
>>
>> ! src/jdk.jshell/share/classes/jdk/internal/jshell/tool/JShellTool.java
>> ! src/jdk.jshell/share/classes/jdk/jshell/Eval.java
>> ! src/jdk.jshell/share/classes/jdk/jshell/JShell.java
>> ! src/jdk.jshell/share/classes/jdk/jshell/JShellImpl.java
>> ! src/jdk.jshell/share/classes/jdk/jshell/Key.java
>> ! src/jdk.jshell/share/classes/jdk/jshell/Snippet.java
>> ! src/jdk.jshell/share/classes/jdk/jshell/SnippetMaps.java
>> ! test/jdk/jshell/KullaTesting.java
>> ! test/jdk/jshell/RejectedFailedTest.java
>> ! test/jdk/jshell/ToolBasicTest.java
>>



More information about the kulla-dev mailing list