From robert.field at oracle.com Wed Oct 7 23:56:49 2015 From: robert.field at oracle.com (robert.field at oracle.com) Date: Wed, 07 Oct 2015 23:56:49 +0000 Subject: hg: kulla/dev/langtools: 8137064: JShell API: circular dependencies cause infinite circular update Message-ID: <201510072356.t97NunOF021882@aojmv0008.oracle.com> Changeset: 632300ebafc9 Author: rfield Date: 2015-10-07 16:56 -0700 URL: http://hg.openjdk.java.net/kulla/dev/langtools/rev/632300ebafc9 8137064: JShell API: circular dependencies cause infinite circular update Summary: Redesign JShell compilation engine to handle circular dependencies. ! src/jdk.jshell/share/classes/jdk/internal/jshell/remote/RemoteAgent.java ! src/jdk.jshell/share/classes/jdk/internal/jshell/tool/JShellTool.java + src/jdk.jshell/share/classes/jdk/jshell/ClassTracker.java ! src/jdk.jshell/share/classes/jdk/jshell/DeclarationSnippet.java ! src/jdk.jshell/share/classes/jdk/jshell/Diag.java ! src/jdk.jshell/share/classes/jdk/jshell/DiagList.java ! src/jdk.jshell/share/classes/jdk/jshell/Eval.java ! src/jdk.jshell/share/classes/jdk/jshell/ExecutionControl.java ! src/jdk.jshell/share/classes/jdk/jshell/ImportSnippet.java ! src/jdk.jshell/share/classes/jdk/jshell/JShell.java ! src/jdk.jshell/share/classes/jdk/jshell/MemoryFileManager.java ! src/jdk.jshell/share/classes/jdk/jshell/OuterWrap.java ! src/jdk.jshell/share/classes/jdk/jshell/Snippet.java ! src/jdk.jshell/share/classes/jdk/jshell/SnippetMaps.java ! src/jdk.jshell/share/classes/jdk/jshell/SourceCodeAnalysis.java ! src/jdk.jshell/share/classes/jdk/jshell/SourceCodeAnalysisImpl.java ! src/jdk.jshell/share/classes/jdk/jshell/TaskFactory.java ! src/jdk.jshell/share/classes/jdk/jshell/Unit.java < src/jdk.jshell/share/classes/jdk/jshell/Compile.java ! test/jdk/jshell/ClassesTest.java ! test/jdk/jshell/KullaTesting.java ! test/jdk/jshell/ToolBasicTest.java From jan.lahoda at oracle.com Fri Oct 9 19:48:58 2015 From: jan.lahoda at oracle.com (Jan Lahoda) Date: Fri, 09 Oct 2015 21:48:58 +0200 Subject: RFR [9] 8134254: JShell API/tool: REPL for Java into JDK9 Message-ID: <56181A2A.5020207@oracle.com> Hi, I'd like to ask for a review of top-level and jdk repository changes needed for the JShell/REPL tool. The top-level repository changes: http://cr.openjdk.java.net/~rfield/jshell_base_webrev_v0/ The jdk repository changes: http://cr.openjdk.java.net/~rfield/jshell_jdk_webrev_v0/ Any feedback is welcome. Thanks! Jan From Alan.Bateman at oracle.com Fri Oct 9 20:02:17 2015 From: Alan.Bateman at oracle.com (Alan Bateman) Date: Fri, 9 Oct 2015 21:02:17 +0100 Subject: RFR [9] 8134254: JShell API/tool: REPL for Java into JDK9 In-Reply-To: <56181A2A.5020207@oracle.com> References: <56181A2A.5020207@oracle.com> Message-ID: <56181D49.8000003@oracle.com> On 09/10/2015 20:48, Jan Lahoda wrote: > Hi, > > I'd like to ask for a review of top-level and jdk repository changes > needed for the JShell/REPL tool. > > The top-level repository changes: > http://cr.openjdk.java.net/~rfield/jshell_base_webrev_v0/ > > The jdk repository changes: > http://cr.openjdk.java.net/~rfield/jshell_jdk_webrev_v0/ > > Any feedback is welcome. Looks okay to me, just surprised to see the dependence on the preferences API. -Alan From jan.lahoda at oracle.com Fri Oct 9 20:13:12 2015 From: jan.lahoda at oracle.com (Jan Lahoda) Date: Fri, 09 Oct 2015 22:13:12 +0200 Subject: RFR [9] 8134254: JShell API/tool: REPL for Java into JDK9 In-Reply-To: <56181D49.8000003@oracle.com> References: <56181A2A.5020207@oracle.com> <56181D49.8000003@oracle.com> Message-ID: <56181FD8.10406@oracle.com> On 9.10.2015 22:02, Alan Bateman wrote: > On 09/10/2015 20:48, Jan Lahoda wrote: >> Hi, >> >> I'd like to ask for a review of top-level and jdk repository changes >> needed for the JShell/REPL tool. >> >> The top-level repository changes: >> http://cr.openjdk.java.net/~rfield/jshell_base_webrev_v0/ >> >> The jdk repository changes: >> http://cr.openjdk.java.net/~rfield/jshell_jdk_webrev_v0/ >> >> Any feedback is welcome. > Looks okay to me, just surprised to see the dependence on the > preferences API. The reason for that dependency is that the JShell tool currently stores the startup script/code (the code that is processed when the tool starts) and the editing history using java.util.prefs.Preferences. Thanks! Jan > > -Alan From sundararajan.athijegannathan at oracle.com Sat Oct 10 01:32:29 2015 From: sundararajan.athijegannathan at oracle.com (Sundararajan Athijegannathan) Date: Sat, 10 Oct 2015 07:02:29 +0530 Subject: RFR [9] 8134254: JShell API/tool: REPL for Java into JDK9 In-Reply-To: <56181A2A.5020207@oracle.com> References: <56181A2A.5020207@oracle.com> Message-ID: <56186AAD.7070309@oracle.com> Looks good to me. -Sundar On 10/10/2015 1:18 AM, Jan Lahoda wrote: > Hi, > > I'd like to ask for a review of top-level and jdk repository changes > needed for the JShell/REPL tool. > > The top-level repository changes: > http://cr.openjdk.java.net/~rfield/jshell_base_webrev_v0/ > > The jdk repository changes: > http://cr.openjdk.java.net/~rfield/jshell_jdk_webrev_v0/ > > Any feedback is welcome. > > Thanks! > > Jan From jan.lahoda at oracle.com Fri Oct 16 13:55:51 2015 From: jan.lahoda at oracle.com (jan.lahoda at oracle.com) Date: Fri, 16 Oct 2015 13:55:51 +0000 Subject: hg: kulla/dev/langtools: 2 new changesets Message-ID: <201510161355.t9GDtp79015878@aojmv0008.oracle.com> Changeset: 2d4ddd268feb Author: jlahoda Date: 2015-10-16 13:46 +0200 URL: http://hg.openjdk.java.net/kulla/dev/langtools/rev/2d4ddd268feb Adding @DefinedBy annotations ! src/jdk.jshell/share/classes/jdk/jshell/MemoryFileManager.java ! src/jdk.jshell/share/classes/jdk/jshell/SourceCodeAnalysisImpl.java ! src/jdk.jshell/share/classes/jdk/jshell/TreeDependencyScanner.java Changeset: cf2fa1607bd0 Author: jlahoda Date: 2015-10-16 15:32 +0200 URL: http://hg.openjdk.java.net/kulla/dev/langtools/rev/cf2fa1607bd0 Adding missing space ! src/jdk.jshell/share/classes/jdk/jshell/ExecutionControl.java From jan.lahoda at oracle.com Mon Oct 19 10:55:39 2015 From: jan.lahoda at oracle.com (jan.lahoda at oracle.com) Date: Mon, 19 Oct 2015 10:55:39 +0000 Subject: hg: kulla/dev/langtools: 2 new changesets Message-ID: <201510191055.t9JAtd1W000846@aojmv0008.oracle.com> Changeset: 88d8b1bde878 Author: jlahoda Date: 2015-10-19 12:51 +0200 URL: http://hg.openjdk.java.net/kulla/dev/langtools/rev/88d8b1bde878 Disabling several broken tests (JDK-8139873, JDK-8139872); fixing jshell's IOTest.java on Windows ! test/jdk/jshell/EditorPadTest.java ! test/jdk/jshell/IOTest.java ! test/jdk/jshell/ShutdownTest.java ! test/jdk/jshell/SnippetStatusListenerTest.java ! test/jdk/jshell/ToolBasicTest.java Changeset: 9963b4712f00 Author: jlahoda Date: 2015-10-19 12:52 +0200 URL: http://hg.openjdk.java.net/kulla/dev/langtools/rev/9963b4712f00 Removing test suite XMLs - test/jdk/jshell/stress.xml - test/jdk/jshell/testng.xml From bitterfoxc at gmail.com Tue Oct 27 16:22:06 2015 From: bitterfoxc at gmail.com (ShinyaYoshida) Date: Wed, 28 Oct 2015 01:22:06 +0900 Subject: RFR 8129421: JShell API: unacceptable suggestions in 'extends', 'implements' in smart completion Message-ID: Hi Jan, I have the patch for the issue which is assigned to you. Could you review this, and can I work for this? Bugs: https://bugs.openjdk.java.net/browse/JDK-8129421 Webrev: http://cr.openjdk.java.net/~shinyafox/kulla/8129421/webrev.00/ Regards, Shinya Yoshida @ JavaOne 2015 From bitterfoxc at gmail.com Tue Oct 27 19:12:43 2015 From: bitterfoxc at gmail.com (ShinyaYoshida) Date: Wed, 28 Oct 2015 04:12:43 +0900 Subject: Should 8081796 be closed? Message-ID: Hi Robert(It was nice to meet you yesterday), It seems to me that 8081796[1] is resolved currently(I don't know which commit fixed this issue). Should, Could we close these issue? [1]: https://bugs.openjdk.java.net/browse/JDK-8081796 Regards, Shinya Yoshida @ JavaOne 2015 From robert.field at oracle.com Tue Oct 27 19:18:20 2015 From: robert.field at oracle.com (Robert Field) Date: Tue, 27 Oct 2015 12:18:20 -0700 Subject: Should 8081796 be closed? In-Reply-To: References: Message-ID: <562FCDFC.8030208@oracle.com> Ah, that was my big circularity overhaul. Closed as duplicate. Thanks! -Robert On 10/27/15 12:12, ShinyaYoshida wrote: > Hi Robert(It was nice to meet you yesterday), > It seems to me that 8081796[1] is resolved currently(I don't know > which commit fixed this issue). > > Should, Could we close these issue? > > [1]: https://bugs.openjdk.java.net/browse/JDK-8081796 > > Regards, > Shinya Yoshida @ JavaOne 2015 From bitterfoxc at gmail.com Tue Oct 27 20:25:36 2015 From: bitterfoxc at gmail.com (ShinyaYoshida) Date: Wed, 28 Oct 2015 05:25:36 +0900 Subject: Should 8081796 be closed? In-Reply-To: <562FCDFC.8030208@oracle.com> References: <562FCDFC.8030208@oracle.com> Message-ID: Thank you for your closing! Regards, Shinya Yoshida @ JavaOne 2015 2015-10-28 4:18 GMT+09:00 Robert Field : > Ah, that was my big circularity overhaul. > > Closed as duplicate. > > Thanks! > > -Robert > > > > > On 10/27/15 12:12, ShinyaYoshida wrote: > >> Hi Robert(It was nice to meet you yesterday), >> It seems to me that 8081796[1] is resolved currently(I don't know which >> commit fixed this issue). >> >> Should, Could we close these issue? >> >> [1]: https://bugs.openjdk.java.net/browse/JDK-8081796 >> >> Regards, >> Shinya Yoshida @ JavaOne 2015 >> > > From cay at horstmann.com Fri Oct 30 00:24:32 2015 From: cay at horstmann.com (Cay Horstmann) Date: Thu, 29 Oct 2015 17:24:32 -0700 Subject: Named result variables Message-ID: <5632B8C0.7050300@horstmann.com> When I teach, I like to use jshell for quick demos. I might predefine Set setOf(T... values) { return new TreeSet<>(Arrays.asList(values)); } and then construct two sets: Set set1 = setOf(1, 2, 3); Set set2 = setOf(2, 3, 5); set1.removeAll(set2) Except, that's a lot of typing, so I don't do that. I do setOf(1, 2, 3); setOf(2, 3, 5); $1.removeAll($2) Note the absence of types. The $n are automatically typed. But I lose track of those $n prettty soon. It would be nice if i could name them. I brought this up at the Java One presentation and suggested /var set1 $1 or /var set2 to name the last $n. Robert thought that was a bit too much like inventing a new langauge feature and suggested that one might be able to solve this with tab completion instead. I thought about this a bit and couldn't come up with a compelling way. Right now, when one hits Tab on a blank line, one is offered a collection of well over 400 possible completions (types, packages, classes, $ variables). Using that to get to something like Set or TreeMap> isn't satisfactory. Does anyone else think that an easy way of naming results is worthwhile? Any ideas on what the user interface should be? Cheers, Cay -- Cay S. Horstmann | http://horstmann.com | mailto:cay at horstmann.com From robert.field at oracle.com Fri Oct 30 06:17:24 2015 From: robert.field at oracle.com (Robert Field) Date: Thu, 29 Oct 2015 23:17:24 -0700 Subject: Named result variables In-Reply-To: <5632B8C0.7050300@horstmann.com> References: <5632B8C0.7050300@horstmann.com> Message-ID: <150b764b938.2767.4011f3a8741ca2aabce58b8b81f42d24@oracle.com> Thanks Cay putting this out for discussion, would love to come up with some nice solution for this. I would like to avoid something that straddles the snippet and command worlds which are now distinct. I don't think I expressed my idea very clearly -- mostly because it isn't at all clear to me ;-) What I was thinking was something vaguely tab completion like, in that you wind up looking at a well formed snippet not all of which you explicitly typed. But not literally a tab nor completion. Thanks, Robert On October 29, 2015 6:50:46 PM Cay Horstmann wrote: > When I teach, I like to use jshell for quick demos. I might predefine > > Set setOf(T... values) { return new > TreeSet<>(Arrays.asList(values)); } > > and then construct two sets: > > Set set1 = setOf(1, 2, 3); > Set set2 = setOf(2, 3, 5); > set1.removeAll(set2) > > Except, that's a lot of typing, so I don't do that. I do > > setOf(1, 2, 3); > setOf(2, 3, 5); > $1.removeAll($2) > > Note the absence of types. The $n are automatically typed. > > But I lose track of those $n prettty soon. It would be nice if i could > name them. > > I brought this up at the Java One presentation and suggested > > /var set1 $1 > > or > > /var set2 > > to name the last $n. > > Robert thought that was a bit too much like inventing a new langauge > feature and suggested that one might be able to solve this with tab > completion instead. > > I thought about this a bit and couldn't come up with a compelling way. > Right now, when one hits Tab on a blank line, one is offered a > collection of well over 400 possible completions (types, packages, > classes, $ variables). Using that to get to something like Set > or TreeMap> isn't satisfactory. > > Does anyone else think that an easy way of naming results is worthwhile? > Any ideas on what the user interface should be? > > Cheers, > > Cay > > > -- > > Cay S. Horstmann | http://horstmann.com | mailto:cay at horstmann.com From robert.field at oracle.com Fri Oct 30 06:48:54 2015 From: robert.field at oracle.com (Robert Field) Date: Thu, 29 Oct 2015 23:48:54 -0700 Subject: Named result variables In-Reply-To: <150b764b938.2767.4011f3a8741ca2aabce58b8b81f42d24@oracle.com> References: <5632B8C0.7050300@horstmann.com> <150b764b938.2767.4011f3a8741ca2aabce58b8b81f42d24@oracle.com> Message-ID: <150b78193f0.2767.4011f3a8741ca2aabce58b8b81f42d24@oracle.com> Keep in mind I'm open to any solution. Let me frame my idea as a strawman so it is easier to shoot arrows at :-) Think: source code transformations that IDEs sometimes do. So, in this case say, ... You type in a complex expression expr. Then you press ctrl-V. The tool generates the type typedecl and an equals sign and sticks the cursor between them so you can type the variable name: typedecl. | = expr: Where | represents the cursor position. Jan can tell me if this is even something jline can do. The idea is, like tab, you type characters which don't correspond to valid Java, but what you see is valid. Of course what character is typed to initiate this is arbitrary. Ideas... -Robert On October 29, 2015 11:17:24 PM Robert Field wrote: > Thanks Cay putting this out for discussion, would love to come up with > some nice solution for this. I would like to avoid something that > straddles the snippet and command worlds which are now distinct. > > I don't think I expressed my idea very clearly -- mostly because it isn't > at all clear to me ;-) > What I was thinking was something vaguely tab completion like, in that you > wind up looking at a well formed snippet not all of which you explicitly > typed. But not literally a tab nor completion. > > Thanks, > Robert > > > On October 29, 2015 6:50:46 PM Cay Horstmann wrote: > >> When I teach, I like to use jshell for quick demos. I might predefine >> >> Set setOf(T... values) { return new >> TreeSet<>(Arrays.asList(values)); } >> >> and then construct two sets: >> >> Set set1 = setOf(1, 2, 3); >> Set set2 = setOf(2, 3, 5); >> set1.removeAll(set2) >> >> Except, that's a lot of typing, so I don't do that. I do >> >> setOf(1, 2, 3); >> setOf(2, 3, 5); >> $1.removeAll($2) >> >> Note the absence of types. The $n are automatically typed. >> >> But I lose track of those $n prettty soon. It would be nice if i could >> name them. >> >> I brought this up at the Java One presentation and suggested >> >> /var set1 $1 >> >> or >> >> /var set2 >> >> to name the last $n. >> >> Robert thought that was a bit too much like inventing a new langauge >> feature and suggested that one might be able to solve this with tab >> completion instead. >> >> I thought about this a bit and couldn't come up with a compelling way. >> Right now, when one hits Tab on a blank line, one is offered a >> collection of well over 400 possible completions (types, packages, >> classes, $ variables). Using that to get to something like Set >> or TreeMap> isn't satisfactory. >> >> Does anyone else think that an easy way of naming results is worthwhile? >> Any ideas on what the user interface should be? >> >> Cheers, >> >> Cay >> >> >> -- >> >> Cay S. Horstmann | http://horstmann.com | mailto:cay at horstmann.com From erik.joelsson at oracle.com Mon Oct 12 08:30:25 2015 From: erik.joelsson at oracle.com (Erik Joelsson) Date: Mon, 12 Oct 2015 08:30:25 -0000 Subject: RFR [9] 8134254: JShell API/tool: REPL for Java into JDK9 In-Reply-To: <56181A2A.5020207@oracle.com> References: <56181A2A.5020207@oracle.com> Message-ID: <561B6F9D.8090602@oracle.com> Looks good to me. /Erik On 2015-10-09 21:48, Jan Lahoda wrote: > Hi, > > I'd like to ask for a review of top-level and jdk repository changes > needed for the JShell/REPL tool. > > The top-level repository changes: > http://cr.openjdk.java.net/~rfield/jshell_base_webrev_v0/ > > The jdk repository changes: > http://cr.openjdk.java.net/~rfield/jshell_jdk_webrev_v0/ > > Any feedback is welcome. > > Thanks! > > Jan