JShell.setIdGenerator/setTempVariableNameGenerator

Robert Field robert.field at oracle.com
Wed Jul 22 14:45:12 UTC 2015


Hmmmm.,..

As I currently use these new methods in the JShell tool, I change them, but 
it could be set once by introducing a variable.

As to event listeners, wouldn't a windowing tool want dynamic listener 
creation/deletion?

I'm not sure to what extent a builder API would hide it, since it is the 
first thing to deal with, but a simple construction example might mean 
people just don't look there much. And it certainly is off to the side.

I like what a builder pattern does to the visibility and defaulting of the 
stream parameters to create.

Thanks,
Robert



On July 22, 2015 5:04:27 AM Brian Goetz <brian.goetz at oracle.com> wrote:

> A builder is also the obvious place to specify event listeners - and then 
> we could prune away the unsubscribe machinery.
>
> On Jul 22, 2015, at 4:25 AM, Paul Sandoz <paul.sandoz at oracle.com> 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.
> >
> > 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