From jan.lahoda at oracle.com Fri Apr 1 11:08:21 2016 From: jan.lahoda at oracle.com (Jan Lahoda) Date: Fri, 1 Apr 2016 13:08:21 +0200 Subject: RFR 8152925: JShell: enable corralling of any type declaration, including enum In-Reply-To: <56FA1F69.2060005@oracle.com> References: <56FA1F69.2060005@oracle.com> Message-ID: <56FE56A5.1020501@oracle.com> In Eval.java, in processClass and processMethod, why split the variable declarations and initializations, and put the initializations into a block? Seems that the variables could have initializers as before? Otherwise, seems OK (and better!) to me. Jan On 29.3.2016 08:23, Robert Field wrote: > Bug: > https://bugs.openjdk.java.net/browse/JDK-8152925 > > Webrev: > http://cr.openjdk.java.net/~rfield/8152925.webrev/ > > Thanks, > Robert > From robert.field at oracle.com Fri Apr 1 16:07:38 2016 From: robert.field at oracle.com (Robert Field) Date: Fri, 01 Apr 2016 09:07:38 -0700 Subject: RFR 8152925: JShell: enable corralling of any type declaration, including enum In-Reply-To: <56FE56A5.1020501@oracle.com> References: <56FA1F69.2060005@oracle.com> <56FE56A5.1020501@oracle.com> Message-ID: <56FE9CCA.6040505@oracle.com> On 04/01/16 04:08, Jan Lahoda wrote: > In Eval.java, in processClass and processMethod, why split the > variable declarations and initializations, and put the initializations > into a block? Seems that the variables could have initializers as before? It was an attempt to structurally prevent reuse of the the mutated tree, but it is probably overkill, I've flatened it back out. > > Otherwise, seems OK (and better!) to me. Yes, cleaner. Thanks for the review! -Robert > > Jan > > On 29.3.2016 08:23, Robert Field wrote: >> Bug: >> https://bugs.openjdk.java.net/browse/JDK-8152925 >> >> Webrev: >> http://cr.openjdk.java.net/~rfield/8152925.webrev/ >> >> Thanks, >> Robert >> From robert.field at oracle.com Mon Apr 4 07:26:26 2016 From: robert.field at oracle.com (Robert Field) Date: Mon, 04 Apr 2016 00:26:26 -0700 Subject: RFR 8147515: JShell: Internationalize Message-ID: <57021722.3060502@oracle.com> Bug: https://bugs.openjdk.java.net/browse/JDK-8147515 Webrev: http://cr.openjdk.java.net/~rfield/8147515.webrev/ Thanks, Robert From kubota.yuji at gmail.com Mon Apr 4 10:33:17 2016 From: kubota.yuji at gmail.com (KUBOTA Yuji) Date: Mon, 4 Apr 2016 19:33:17 +0900 Subject: JShell: three small proposal/feedback Message-ID: Hi REPL team, I enjoyed debugging by using very good REPL - JShell. And I would like to add following (small) changes for usability. 1. /edit display warn instead of quit by HeadlessException in headless mode Unfortunately, I did not think the default editor uses swing, so I got HeadlessException when I used /edit on a headless server, then my working log has gone. So I want that JShell warn instead of suddenly quit, as [1]. 2. /-n return the available range rather than calculated "n" Just to avoid small confusion as below. Example: -> /-9 | Cannot find snippet 0 ( - current implementation) | Cannot find snippet, select between 1 - 8 ( - proposal [2]) 3. Implement /show command to confirm the current configuration We can set configuration, but cannot check current configuration except defined feedback modes by /help /set feedback. Should we provide /show command for easy check as below? Example for feedback mode: -> /set newmode test | Created new feedback mode: test -> /show feedback | Currently feedback mode: normal | All defined feedback mode: normal, test, off If they accepted, I want to file them to JBS and to upload webrev when ready. note: I'm jdk9 author, not committer. Thanks! Yuji [1]: patch for /edit diff --git a/src/jdk.jshell/share/classes/jdk/internal/jshell/tool/JShellTool.java b/src/jdk.jshell/share/classes/jdk/internal/jshell/tool/JShellTool.java --- a/src/jdk.jshell/share/classes/jdk/internal/jshell/tool/JShellTool.java +++ b/src/jdk.jshell/share/classes/jdk/internal/jshell/tool/JShellTool.java @@ -1523,7 +1585,11 @@ Consumer saveHandler = new SaveHandler(src, srcSet); Consumer errorHandler = s -> hard("Edit Error: %s", s); if (editor == null) { - EditPad.edit(errorHandler, src, saveHandler); + try { + EditPad.edit(errorHandler, src, saveHandler); + } catch (HeadlessException ex) { + hard("Cannot launch editor in headless mode. Try /set editor to use external editor."); + } } else { ExternalEditor.edit(editor, errorHandler, src, saveHandler, input); } [2]: patch for /-n diff --git a/src/jdk.jshell/share/classes/jdk/internal/jshell/tool/JShellTool.java b/src/jdk.jshell/share/classes/jdk/internal/jshell/tool/JShellTool.java --- a/src/jdk.jshell/share/classes/jdk/internal/jshell/tool/JShellTool.java +++ b/src/jdk.jshell/share/classes/jdk/internal/jshell/tool/JShellTool.java @@ -1777,7 +1843,7 @@ if (index >= 0 && index < keys.size()) { rerunSnippet(keys.get(index)); } else { - hard("Cannot find snippet %d", index + 1); + hard("Cannot find snippet, select between 1 - %d", keys.size()); return false; } return true; From jan.lahoda at oracle.com Mon Apr 4 11:36:24 2016 From: jan.lahoda at oracle.com (Jan Lahoda) Date: Mon, 4 Apr 2016 13:36:24 +0200 Subject: RFR: JDK-8153243: JShell: make docs --- should generate JShell API docs Message-ID: <570251B8.9020807@oracle.com> Hi, Bug: https://bugs.openjdk.java.net/browse/JDK-8153243 Javadoc for JShell API should be part of the "make docs". Changes to the top-level repository: http://cr.openjdk.java.net/~jlahoda/8153243/webrev.00/top-level/ Small tweaks to the langtools repository (JShell API javadoc) to avoid errors when building the javadoc: http://cr.openjdk.java.net/~jlahoda/8153243/webrev.00/langtools/ Thanks, Jan From erik.joelsson at oracle.com Mon Apr 4 11:45:32 2016 From: erik.joelsson at oracle.com (Erik Joelsson) Date: Mon, 4 Apr 2016 13:45:32 +0200 Subject: RFR: JDK-8153243: JShell: make docs --- should generate JShell API docs In-Reply-To: <570251B8.9020807@oracle.com> References: <570251B8.9020807@oracle.com> Message-ID: <570253DC.1070200@oracle.com> Looks good to me. /Erik On 2016-04-04 13:36, Jan Lahoda wrote: > Hi, > > Bug: > https://bugs.openjdk.java.net/browse/JDK-8153243 > > Javadoc for JShell API should be part of the "make docs". > > Changes to the top-level repository: > http://cr.openjdk.java.net/~jlahoda/8153243/webrev.00/top-level/ > > Small tweaks to the langtools repository (JShell API javadoc) to avoid > errors when building the javadoc: > http://cr.openjdk.java.net/~jlahoda/8153243/webrev.00/langtools/ > > Thanks, > Jan From jan.lahoda at oracle.com Mon Apr 4 12:55:50 2016 From: jan.lahoda at oracle.com (Jan Lahoda) Date: Mon, 4 Apr 2016 14:55:50 +0200 Subject: RFR 8147515: JShell: Internationalize In-Reply-To: <57021722.3060502@oracle.com> References: <57021722.3060502@oracle.com> Message-ID: <57026456.2030605@oracle.com> Seems OK to me. Some small feedback below: Feedback.java: -unused imports JShellTool.java: -constructor - javadoc for @param prefs: @param prefs preferences to use -prefix(String s, String leading): would be better to use System.getProperty("line.separator") instead of "\n"? -Command: we could infer the helpKey from the command in most cases; but I am fine with the current state as well. ToolLocaleMessageTest.java: -the "jdk.jdeps/com.sun.tools.javap" in @modules is most probably not needed with the current toolbox.ToolBox Jan On 4.4.2016 09:26, Robert Field wrote: > Bug: > https://bugs.openjdk.java.net/browse/JDK-8147515 > > Webrev: > http://cr.openjdk.java.net/~rfield/8147515.webrev/ > > Thanks, > Robert > From robert.field at oracle.com Mon Apr 4 16:05:26 2016 From: robert.field at oracle.com (Robert Field) Date: Mon, 04 Apr 2016 09:05:26 -0700 Subject: JShell: three small proposal/feedback In-Reply-To: References: Message-ID: <570290C6.6060201@oracle.com> Thank you Yuji! Comments inline. On 04/04/16 03:33, KUBOTA Yuji wrote: > Hi REPL team, > > I enjoyed debugging by using very good REPL - JShell. > And I would like to add following (small) changes for usability. > > 1. /edit display warn instead of quit by HeadlessException in headless mode > > Unfortunately, I did not think the default editor uses swing, so I got > HeadlessException when I used /edit on a headless server, then > my working log has gone. So I want that JShell warn instead of > suddenly quit, as [1]. That would be good. > > 2. /-n return the available range rather than calculated "n" > > Just to avoid small confusion as below. > > Example: > -> /-9 > | Cannot find snippet 0 ( - current implementation) > | Cannot find snippet, select between 1 - 8 ( - proposal [2]) How would this be useful to you? I'm thinking there might be a more intuitive approach. > > 3. Implement /show command to confirm the current configuration > > We can set configuration, but cannot check current configuration > except defined feedback modes by /help /set feedback. > Should we provide /show command for easy check as below? > > Example for feedback mode: > -> /set newmode test > | Created new feedback mode: test > > -> /show feedback > | Currently feedback mode: normal > | All defined feedback mode: normal, test, off Indeed, some kind of query for configuration is needed. However start can be big (though that can be saved), and format can be huge. How would prompt be displayed? > > > If they accepted, I want to file them to JBS and to upload webrev when ready. > note: I'm jdk9 author, not committer. Certainly file the first one. I'm about to push internationalization of the JShell, so that will change anything with output. Let's kick the other two around a bit more. Thanks, Robert > > Thanks! > Yuji > > [1]: patch for /edit > diff --git a/src/jdk.jshell/share/classes/jdk/internal/jshell/tool/JShellTool.java > b/src/jdk.jshell/share/classes/jdk/internal/jshell/tool/JShellTool.java > --- a/src/jdk.jshell/share/classes/jdk/internal/jshell/tool/JShellTool.java > +++ b/src/jdk.jshell/share/classes/jdk/internal/jshell/tool/JShellTool.java > @@ -1523,7 +1585,11 @@ > Consumer saveHandler = new SaveHandler(src, srcSet); > Consumer errorHandler = s -> hard("Edit Error: %s", s); > if (editor == null) { > - EditPad.edit(errorHandler, src, saveHandler); > + try { > + EditPad.edit(errorHandler, src, saveHandler); > + } catch (HeadlessException ex) { > + hard("Cannot launch editor in headless mode. Try /set > editor to use external editor."); > + } > } else { > ExternalEditor.edit(editor, errorHandler, src, saveHandler, input); > } > > [2]: patch for /-n > diff --git a/src/jdk.jshell/share/classes/jdk/internal/jshell/tool/JShellTool.java > b/src/jdk.jshell/share/classes/jdk/internal/jshell/tool/JShellTool.java > --- a/src/jdk.jshell/share/classes/jdk/internal/jshell/tool/JShellTool.java > +++ b/src/jdk.jshell/share/classes/jdk/internal/jshell/tool/JShellTool.java > @@ -1777,7 +1843,7 @@ > if (index >= 0 && index < keys.size()) { > rerunSnippet(keys.get(index)); > } else { > - hard("Cannot find snippet %d", index + 1); > + hard("Cannot find snippet, select between 1 - %d", > keys.size()); > return false; > } > return true; From li.jiang at oracle.com Mon Apr 4 12:26:18 2016 From: li.jiang at oracle.com (Li Jiang) Date: Mon, 4 Apr 2016 20:26:18 +0800 Subject: RFR 8147515: JShell: Internationalize In-Reply-To: <57021722.3060502@oracle.com> References: <57021722.3060502@oracle.com> Message-ID: <57025D6A.6000008@oracle.com> The format of properties files looks good to me. Thanks, Leo On 4/4/2016 3:26 PM, Robert Field wrote: > Bug: > https://bugs.openjdk.java.net/browse/JDK-8147515 > > Webrev: > http://cr.openjdk.java.net/~rfield/8147515.webrev/ > > Thanks, > Robert > From brian.goetz at oracle.com Mon Apr 4 16:54:31 2016 From: brian.goetz at oracle.com (Brian Goetz) Date: Mon, 4 Apr 2016 12:54:31 -0400 Subject: JShell: three small proposal/feedback In-Reply-To: <570290C6.6060201@oracle.com> References: <570290C6.6060201@oracle.com> Message-ID: <57029C47.904@oracle.com> >> >> Unfortunately, I did not think the default editor uses swing, so I got >> HeadlessException when I used /edit on a headless server, then >> my working log has gone. So I want that JShell warn instead of >> suddenly quit, as [1]. > > That would be good. I might extend this to "catch (RuntimeException e)" -- if there's any problem loading the editor, the show should go on. From robert.field at oracle.com Mon Apr 4 17:03:25 2016 From: robert.field at oracle.com (Robert Field) Date: Mon, 04 Apr 2016 10:03:25 -0700 Subject: RFR: JDK-8153243: JShell: make docs --- should generate JShell API docs In-Reply-To: <570251B8.9020807@oracle.com> References: <570251B8.9020807@oracle.com> Message-ID: <57029E5D.6040800@oracle.com> Doc changes look good. -Robert On 04/04/16 04:36, Jan Lahoda wrote: > Hi, > > Bug: > https://bugs.openjdk.java.net/browse/JDK-8153243 > > Javadoc for JShell API should be part of the "make docs". > > Changes to the top-level repository: > http://cr.openjdk.java.net/~jlahoda/8153243/webrev.00/top-level/ > > Small tweaks to the langtools repository (JShell API javadoc) to avoid > errors when building the javadoc: > http://cr.openjdk.java.net/~jlahoda/8153243/webrev.00/langtools/ > > Thanks, > Jan From robert.field at oracle.com Mon Apr 4 17:20:44 2016 From: robert.field at oracle.com (Robert Field) Date: Mon, 04 Apr 2016 10:20:44 -0700 Subject: RFR 8147515: JShell: Internationalize In-Reply-To: <57026456.2030605@oracle.com> References: <57021722.3060502@oracle.com> <57026456.2030605@oracle.com> Message-ID: <5702A26C.6010503@oracle.com> On 04/04/16 05:55, Jan Lahoda wrote: > Seems OK to me. Some small feedback below: > > Feedback.java: > -unused imports Removed > > JShellTool.java: > -constructor - javadoc for @param prefs: > @param prefs preferences to use Changed > > -prefix(String s, String leading): > would be better to use System.getProperty("line.separator") instead of > "\n"? Done > > -Command: we could infer the helpKey from the command in most cases; > but I am fine with the current state as well. Added constructor that computes the helpKey > > ToolLocaleMessageTest.java: > -the "jdk.jdeps/com.sun.tools.javap" in @modules is most probably not > needed with the current toolbox.ToolBox A bunch of tests have this, should be removed together. Thanks! -Robert > > Jan > > On 4.4.2016 09:26, Robert Field wrote: >> Bug: >> https://bugs.openjdk.java.net/browse/JDK-8147515 >> >> Webrev: >> http://cr.openjdk.java.net/~rfield/8147515.webrev/ >> >> Thanks, >> Robert >> From john.r.rose at oracle.com Mon Apr 4 17:57:47 2016 From: john.r.rose at oracle.com (John Rose) Date: Mon, 4 Apr 2016 10:57:47 -0700 Subject: JShell: three small proposal/feedback In-Reply-To: <570290C6.6060201@oracle.com> References: <570290C6.6060201@oracle.com> Message-ID: On Apr 4, 2016, at 9:05 AM, Robert Field wrote: > > Indeed, some kind of query for configuration is needed. However start can be big (though that can be saved), and format can be huge. How would prompt be displayed? Suggestions: a. Organize the output to be like a /history dump that shows how to recover the relevant state. (Could be verbose.) b. Organize the output to be like the gdb command "set show". (E.g., "set show platform".) Suggests an organization for settings too. From robert.field at oracle.com Mon Apr 4 19:27:42 2016 From: robert.field at oracle.com (Robert Field) Date: Mon, 04 Apr 2016 12:27:42 -0700 Subject: RFR (xxs) 8153417: jshell tool: use test passed locale to retrieve ResourceBundle Message-ID: <5702C02E.1030708@oracle.com> Bug: https://bugs.openjdk.java.net/browse/JDK-8153417 Webrev: http://cr.openjdk.java.net/~rfield/8153417.webrev/ Thanks, Robert From jan.lahoda at oracle.com Mon Apr 4 19:57:17 2016 From: jan.lahoda at oracle.com (Jan Lahoda) Date: Mon, 4 Apr 2016 21:57:17 +0200 Subject: RFR (xxs) 8153417: jshell tool: use test passed locale to retrieve ResourceBundle In-Reply-To: <5702C02E.1030708@oracle.com> References: <5702C02E.1030708@oracle.com> Message-ID: <5702C71D.8030601@oracle.com> Seems OK to me. There is another getBundle in JShellTool.version(String), might be good to use the locale there as well. Jan On 4.4.2016 21:27, Robert Field wrote: > Bug: > https://bugs.openjdk.java.net/browse/JDK-8153417 > > Webrev: > http://cr.openjdk.java.net/~rfield/8153417.webrev/ > > Thanks, > Robert > From robert.field at oracle.com Tue Apr 5 03:49:57 2016 From: robert.field at oracle.com (Robert Field) Date: Mon, 04 Apr 2016 20:49:57 -0700 Subject: RFR (s) 8153482: jdk/jshell/StartOptionTest.java fails on Windows after JDK-8147515 Message-ID: <570335E5.4070300@oracle.com> Bug: https://bugs.openjdk.java.net/browse/JDK-8153482 Webrev: http://cr.openjdk.java.net/~rfield/8153482.webrev/ Thanks, Robert From amy.lu at oracle.com Tue Apr 5 04:33:15 2016 From: amy.lu at oracle.com (Amy Lu) Date: Tue, 5 Apr 2016 12:33:15 +0800 Subject: RFR (s) 8153482: jdk/jshell/StartOptionTest.java fails on Windows after JDK-8147515 In-Reply-To: <570335E5.4070300@oracle.com> References: <570335E5.4070300@oracle.com> Message-ID: <5703400B.4070101@oracle.com> Looks fine. Thank you for the quick fix! (As I'm not openjdk reviewer, please wait for reviewer's feedback.) Thanks, Amy On 4/5/16 11:49 AM, Robert Field wrote: > Bug: > https://bugs.openjdk.java.net/browse/JDK-8153482 > > Webrev: > http://cr.openjdk.java.net/~rfield/8153482.webrev/ > > Thanks, > Robert > From jan.lahoda at oracle.com Tue Apr 5 06:49:33 2016 From: jan.lahoda at oracle.com (Jan Lahoda) Date: Tue, 5 Apr 2016 08:49:33 +0200 Subject: RFR (s) 8153482: jdk/jshell/StartOptionTest.java fails on Windows after JDK-8147515 In-Reply-To: <5703400B.4070101@oracle.com> References: <570335E5.4070300@oracle.com> <5703400B.4070101@oracle.com> Message-ID: <57035FFD.6040307@oracle.com> I'm fine with this. Jan On 5.4.2016 06:33, Amy Lu wrote: > Looks fine. > > Thank you for the quick fix! > > (As I'm not openjdk reviewer, please wait for reviewer's feedback.) > > Thanks, > Amy > > On 4/5/16 11:49 AM, Robert Field wrote: >> Bug: >> https://bugs.openjdk.java.net/browse/JDK-8153482 >> >> Webrev: >> http://cr.openjdk.java.net/~rfield/8153482.webrev/ >> >> Thanks, >> Robert >> > From kubota.yuji at gmail.com Tue Apr 5 10:11:31 2016 From: kubota.yuji at gmail.com (KUBOTA Yuji) Date: Tue, 5 Apr 2016 19:11:31 +0900 Subject: JShell: three small proposal/feedback In-Reply-To: References: <570290C6.6060201@oracle.com> Message-ID: Hi all, Thank you for your quickly responses! >> 1. /edit display warn instead of quit by HeadlessException in headless mode 2016-04-05 1:54 GMT+09:00 Brian Goetz : >> That would be good. > I might extend this to "catch (RuntimeException e)" -- if there's any > problem loading the editor, the show should go on. Thanks for comments. I will extend the exception to RuntimeException, then file it. Please wait a bit. -- I'm a beginner author :p >> 2. /-n return the available range rather than calculated "n" 2016-04-05 1:05 GMT+09:00 Robert Field : > How would this be useful to you? I'm thinking there might be a more > intuitive approach. Sorry for poor description. When I got the result "0" (or negative number) for the first time, I could not understand what the number mean. So I think we should display the available range instead of calculated number by jshell. I agree with your comment, I think that jshell should show how to confirm previous snippets -- /list all or add /list previous to show the list with - line as below. Example: -> /-10 | Cannot find snippet, select - between 1 - 9 | To show previous snippet with -, try /list previous -> /list previous -9 : import java.util.*; -8 : import java.io.*; -7 : import java.math.*; : -2 : void printf(String format, Object... args) { System.out.printf(format, args); } -1 : printf("Add by hand") If /list previous is acceptable, I will add it. Is it acceptable and intuitive? >> 3. Implement /show command to confirm the current configuration 2016-04-05 2:57 GMT+09:00 John Rose : > On Apr 4, 2016, at 9:05 AM, Robert Field wrote: >> >> Indeed, some kind of query for configuration is needed. However start can be big (though that can be saved), and format can be huge. How would prompt be displayed? > > Suggestions: > a. Organize the output to be like a /history dump that shows how to recover the relevant state. (Could be verbose.) > b. Organize the output to be like the gdb command "set show". (E.g., "set show platform".) Suggests an organization for settings too. Thanks for comment and suggestions! Yes, especially format can be huge. So I would like to adopt suggestion a. to enable recovering easy. I think we might select the following two approach. i) Adopt suggestion a. to "/show format" and "/show [editor|start|feedback|mode|prompt] history" ii) Adopt suggestion a. to all /show commands i): Some commands show information with description, and others dump history as below. - "/show format" display the history of all /set format command. - "/show format " display the history of /set format command. - "/show start" show current configured file name. - "/show start history" display the history of /set start . - "/show [editor|feedback|mode|prompt]" show current configuration with description as "start" - "/show [editor|feedback|mode|prompt]" history" display the history of related command as "start" ii): /show XXX always display the history of /set XXX commands as /history I think i) is better approach for users. Could you please tell me what do you think about it? Thanks for reading! Yuji. From kubota.yuji at gmail.com Thu Apr 7 09:04:33 2016 From: kubota.yuji at gmail.com (KUBOTA Yuji) Date: Thu, 7 Apr 2016 18:04:33 +0900 Subject: RFR 8153716: JShell tool: should warn when failed to launch editor Message-ID: I filed the proposal which reported at below: http://mail.openjdk.java.net/pipermail/kulla-dev/2016-April/001305.html Bug: https://bugs.openjdk.java.net/browse/JDK-8153716 Webrev: http://cr.openjdk.java.net/~ykubota/8153716/webrev.00/ I'm an author, not committer, so I need sponsor. Please review it. Thanks, Yuji From anthony.vanelverdinghe at gmail.com Thu Apr 7 10:33:56 2016 From: anthony.vanelverdinghe at gmail.com (Anthony Vanelverdinghe) Date: Thu, 7 Apr 2016 12:33:56 +0200 Subject: JShell feedback Message-ID: <57063794.6080804@gmail.com> Hi Here's my feedback after some initial jshell experiments: ** what's an unresolvable identifier (in the context of " i")? I expected the following: -> PI i would result in a proposal to change it to Math.PI, but it doesn't. Actually, I haven't been able to make this shortcut do anything at all yet (using "cmd" on Windows 7 and JDK 9-ea+111). What's an example usage of this shortcut? The following are issues/RFEs I've come across. If you'd rather have me file these through bugs.java.com, just let me know. ** consider the following sequence: -> double a = 2 -> Math.sin( -> <9x backspace>3 -> double b = 4 -> double c = 5 -> Math.sin( then at this point it immediately asks me if I want to display all possibilities: -> Math.sin(Display all 457 possibilities? (y or n) instead of proposing me the short list again first (now with a, b, c and the temporary variable). The same is true if, instead of "<9x backspace>3", I do "" to cancel the command. ** when I do "Math.sin(" and get: -> Math.sin(Display all 455 possibilities? (y or n) I'm unable to cancel the command with "" directly ** when doing Shift-, it would be useful if the actual parameter names were shown. For this, the classes would need to have been compiled with "-parameters" though. For methods defined through jshell, I guess this ought to be possible since jshell handles the compilation itself. Apparently, JDKs and JREs currently don't provide parameter info, though I think they should for jshell's sake: having meaningful parameter names readily available can save a round trip to the Javadocs, which I feel is important in a REPL environment. ** it would be nice to have a command (such as Windows' "/cls") and/or shortcut (such as Bash' "Ctrl+L") to clear the screen Kind regards, Anthony From robert.field at oracle.com Thu Apr 7 16:14:16 2016 From: robert.field at oracle.com (Robert Field) Date: Thu, 07 Apr 2016 09:14:16 -0700 Subject: RFR 8153716: JShell tool: should warn when failed to launch editor In-Reply-To: References: Message-ID: <57068758.5040408@oracle.com> Yuji, Looks good, I wonder if showing the exception (or the exception message) would be useful, rather than just a mystery of it not launching? For example, seeing that it is headless. -Robert On 04/07/16 02:04, KUBOTA Yuji wrote: > I filed the proposal which reported at below: > http://mail.openjdk.java.net/pipermail/kulla-dev/2016-April/001305.html > > Bug: > https://bugs.openjdk.java.net/browse/JDK-8153716 > > Webrev: > http://cr.openjdk.java.net/~ykubota/8153716/webrev.00/ > > I'm an author, not committer, so I need sponsor. > Please review it. > > Thanks, > Yuji From robert.field at oracle.com Thu Apr 7 16:20:03 2016 From: robert.field at oracle.com (Robert Field) Date: Thu, 07 Apr 2016 09:20:03 -0700 Subject: JShell user experience survey Message-ID: <570688B3.9010100@oracle.com> Thank you to all who took the survey -- the information is very useful. If anyone did not receive the survey and wishes to respond, you can use the link below. https://www.surveymonkey.com/r/TLGMT2J I'll be sending out the analysis of the survey tomorrow. Thanks, Robert From grigory.ptashko at gmail.com Thu Apr 7 16:33:07 2016 From: grigory.ptashko at gmail.com (Grigory Ptashko) Date: Thu, 7 Apr 2016 19:33:07 +0300 Subject: commandStop() and the in-process execution of snippets Message-ID: <9C569C57-E2C2-4264-8195-358D84B907AF@gmail.com> Hello. I want to implement the in-process execution of JShell snippets without using the JDI env and a separate VM. I've studied the ExecutionControl and the RemoteAgent sources and understood how JShell works in this part. Actually, I've already wrote a simple LocalExcutionControl which allows executing the snippets in-process. I now see the problem in the stopping of the client code, i.e. the implementation of the commandStop() method. So I've got a question. Do I get it right that the JDI was chosen in order to be able to stop all the client code threads? I mean that a user is possibly able to create as muany threads as she wants. And the only way to stop them all at once is executing them in a separate VM? Do you see any solution to this when launching the client code in-process? Thank you. -- Best regards, Grigory Ptashko +7 (916) 1489766 grigory.ptashko at gmail.com facebook.com/GrigoryPtashko From jan.lahoda at oracle.com Thu Apr 7 16:39:03 2016 From: jan.lahoda at oracle.com (Jan Lahoda) Date: Thu, 7 Apr 2016 18:39:03 +0200 Subject: JShell feedback In-Reply-To: <57063794.6080804@gmail.com> References: <57063794.6080804@gmail.com> Message-ID: <57068D27.1070903@oracle.com> Hi Anthony, Thanks for the comments. On 7.4.2016 12:33, Anthony Vanelverdinghe wrote: > Hi > > Here's my feedback after some initial jshell experiments: > > ** what's an unresolvable identifier (in the context of " > i")? I expected the following: > -> PI i > would result in a proposal to change it to Math.PI, but it doesn't. > Actually, I haven't been able to make this shortcut do anything at all > yet (using "cmd" on Windows 7 and JDK 9-ea+111). What's an example usage > of this shortcut? For Windows, this is needed: https://bugs.openjdk.java.net/browse/JDK-8147984 but not approved yet. But, this feature currently only works for on classes, e.g. it should be able to fill in import for e.g. java.util.concurrent.atomic.AtomicInteger. My concern here is that if we will scan class members, the time needed by the scanning might be too big. > > The following are issues/RFEs I've come across. If you'd rather have me > file these through bugs.java.com, just let me know. > > ** consider the following sequence: > -> double a = 2 > -> Math.sin( > -> <9x backspace>3 > -> double b = 4 > -> double c = 5 > -> Math.sin( > then at this point it immediately asks me if I want to display all > possibilities: > -> Math.sin(Display all 457 possibilities? (y or n) > instead of proposing me the short list again first (now with a, b, c and > the temporary variable). The same is true if, instead of "<9x > backspace>3", I do "" to cancel the command. I've filled: https://bugs.openjdk.java.net/browse/JDK-8153759 > > ** when I do "Math.sin(" and get: > -> Math.sin(Display all 455 possibilities? (y or n) > I'm unable to cancel the command with "" directly I've filled: https://bugs.openjdk.java.net/browse/JDK-8153760 I'll see what can be done (this is jline behavior). > > ** when doing Shift-, it would be useful if the actual parameter > names were shown. For this, the classes would need to have been compiled > with "-parameters" though. For methods defined through jshell, I guess > this ought to be possible since jshell handles the compilation itself. > Apparently, JDKs and JREs currently don't provide parameter info, though > I think they should for jshell's sake: having meaningful parameter names > readily available can save a round trip to the Javadocs, which I feel is > important in a REPL environment. I've filled: https://bugs.openjdk.java.net/browse/JDK-8153761 > > ** it would be nice to have a command (such as Windows' "/cls") and/or > shortcut (such as Bash' "Ctrl+L") to clear the screen I've filled: https://bugs.openjdk.java.net/browse/JDK-8153762 But this might be tricky, esp. on Windows. Thanks, Jan > > Kind regards, > Anthony From robert.field at oracle.com Thu Apr 7 17:54:02 2016 From: robert.field at oracle.com (Robert Field) Date: Thu, 07 Apr 2016 10:54:02 -0700 Subject: commandStop() and the in-process execution of snippets In-Reply-To: <9C569C57-E2C2-4264-8195-358D84B907AF@gmail.com> References: <9C569C57-E2C2-4264-8195-358D84B907AF@gmail.com> Message-ID: <153f1dc0690.2765.4011f3a8741ca2aabce58b8b81f42d24@oracle.com> Jan, any insights on stop? Grigory, JDI was chosen for redefine classes functionality. Remote execution, in general, was chosen to insulate the tool from crashes and other code misbehavior. Stop was an extra benefit that Jan discovered after we switched to remote/JDI. Very cool on the LocalExcutionControl implementation. I think you can get quite useful functionality without redefine classes or stop (though I think there may be less elegant solutions to the latter). If you are able to launch with -javaagent there should be a solution for redefine too. -Robert On April 7, 2016 9:33:51 AM Grigory Ptashko wrote: > Hello. > > I want to implement the in-process execution of JShell snippets without using > the JDI env and a separate VM. > > I've studied the ExecutionControl and the RemoteAgent sources and > understood how > JShell works in this part. Actually, I've already wrote a simple > LocalExcutionControl which allows > executing the snippets in-process. I now see the problem in the stopping of the > client code, i.e. the implementation of the commandStop() method. > > So I've got a question. Do I get it right that the JDI was chosen > in order to be able to stop all the client code threads? I mean that a user > is possibly able to create as muany threads as she wants. And the only way to > stop them all at once is executing them in a separate VM? > > Do you see any solution to this when launching the client code in-process? > > Thank you. > > -- > Best regards, > Grigory Ptashko > > +7 (916) 1489766 > grigory.ptashko at gmail.com > facebook.com/GrigoryPtashko > From kubota.yuji at gmail.com Fri Apr 8 06:25:18 2016 From: kubota.yuji at gmail.com (KUBOTA Yuji) Date: Fri, 8 Apr 2016 15:25:18 +0900 Subject: RFR 8153716: JShell tool: should warn when failed to launch editor In-Reply-To: <57068758.5040408@oracle.com> References: <57068758.5040408@oracle.com> Message-ID: Hi Robert, Thanks for comment. Certainly for users, "something happen" is very unkind. I updated my patch to show the exception message: http://cr.openjdk.java.net/~ykubota/8153716/webrev.01/ Thanks, Yuji 2016-04-08 1:14 GMT+09:00 Robert Field : > Yuji, > > Looks good, I wonder if showing the exception (or the exception message) > would be useful, rather than just a mystery of it not launching? For > example, seeing that it is headless. > > -Robert > > > On 04/07/16 02:04, KUBOTA Yuji wrote: >> >> I filed the proposal which reported at below: >> http://mail.openjdk.java.net/pipermail/kulla-dev/2016-April/001305.html >> >> Bug: >> https://bugs.openjdk.java.net/browse/JDK-8153716 >> >> Webrev: >> http://cr.openjdk.java.net/~ykubota/8153716/webrev.00/ >> >> I'm an author, not committer, so I need sponsor. >> Please review it. >> >> Thanks, >> Yuji > > From robert.field at oracle.com Fri Apr 8 06:36:10 2016 From: robert.field at oracle.com (Robert Field) Date: Thu, 07 Apr 2016 23:36:10 -0700 Subject: RFR 8153716: JShell tool: should warn when failed to launch editor In-Reply-To: References: <57068758.5040408@oracle.com> Message-ID: <153f495c790.2784.4011f3a8741ca2aabce58b8b81f42d24@oracle.com> Nice. I'll push in the morning. -Robert On April 7, 2016 11:25:22 PM KUBOTA Yuji wrote: > Hi Robert, > > Thanks for comment. Certainly for users, "something happen" is very unkind. > > I updated my patch to show the exception message: > http://cr.openjdk.java.net/~ykubota/8153716/webrev.01/ > > Thanks, > Yuji > > 2016-04-08 1:14 GMT+09:00 Robert Field : >> Yuji, >> >> Looks good, I wonder if showing the exception (or the exception message) >> would be useful, rather than just a mystery of it not launching? For >> example, seeing that it is headless. >> >> -Robert >> >> >> On 04/07/16 02:04, KUBOTA Yuji wrote: >>> >>> I filed the proposal which reported at below: >>> http://mail.openjdk.java.net/pipermail/kulla-dev/2016-April/001305.html >>> >>> Bug: >>> https://bugs.openjdk.java.net/browse/JDK-8153716 >>> >>> Webrev: >>> http://cr.openjdk.java.net/~ykubota/8153716/webrev.00/ >>> >>> I'm an author, not committer, so I need sponsor. >>> Please review it. >>> >>> Thanks, >>> Yuji >> >> From robert.field at oracle.com Fri Apr 8 06:47:30 2016 From: robert.field at oracle.com (Robert Field) Date: Thu, 07 Apr 2016 23:47:30 -0700 Subject: RFR 8153716: JShell tool: should warn when failed to launch editor In-Reply-To: <153f495c790.2784.4011f3a8741ca2aabce58b8b81f42d24@oracle.com> References: <57068758.5040408@oracle.com> <153f495c790.2784.4011f3a8741ca2aabce58b8b81f42d24@oracle.com> Message-ID: <153f4a027d0.2784.4011f3a8741ca2aabce58b8b81f42d24@oracle.com> It will need a regression test, if possible. Is there a way to reproduce this exception within Java? Make Java think it is headless? Thanks, Robert On April 7, 2016 11:36:10 PM Robert Field wrote: > Nice. I'll push in the morning. > > -Robert > > > On April 7, 2016 11:25:22 PM KUBOTA Yuji wrote: > >> Hi Robert, >> >> Thanks for comment. Certainly for users, "something happen" is very unkind. >> >> I updated my patch to show the exception message: >> http://cr.openjdk.java.net/~ykubota/8153716/webrev.01/ >> >> Thanks, >> Yuji >> >> 2016-04-08 1:14 GMT+09:00 Robert Field : >>> Yuji, >>> >>> Looks good, I wonder if showing the exception (or the exception message) >>> would be useful, rather than just a mystery of it not launching? For >>> example, seeing that it is headless. >>> >>> -Robert >>> >>> >>> On 04/07/16 02:04, KUBOTA Yuji wrote: >>>> >>>> I filed the proposal which reported at below: >>>> http://mail.openjdk.java.net/pipermail/kulla-dev/2016-April/001305.html >>>> >>>> Bug: >>>> https://bugs.openjdk.java.net/browse/JDK-8153716 >>>> >>>> Webrev: >>>> http://cr.openjdk.java.net/~ykubota/8153716/webrev.00/ >>>> >>>> I'm an author, not committer, so I need sponsor. >>>> Please review it. >>>> >>>> Thanks, >>>> Yuji >>> >>> From kubota.yuji at gmail.com Fri Apr 8 08:49:46 2016 From: kubota.yuji at gmail.com (KUBOTA Yuji) Date: Fri, 8 Apr 2016 17:49:46 +0900 Subject: RFR 8153716: JShell tool: should warn when failed to launch editor In-Reply-To: <153f4a027d0.2784.4011f3a8741ca2aabce58b8b81f42d24@oracle.com> References: <57068758.5040408@oracle.com> <153f495c790.2784.4011f3a8741ca2aabce58b8b81f42d24@oracle.com> <153f4a027d0.2784.4011f3a8741ca2aabce58b8b81f42d24@oracle.com> Message-ID: Sorry, I do not have an idea to reproduce within Java. I checked some tests which may be related with headless, e.g., jdk/test/java/awt/Toolkit/Headless/HeadlessToolkit.java. But they require to run in headless mode. Thanks, Yuji 2016-04-08 15:47 GMT+09:00 Robert Field : > It will need a regression test, if possible. Is there a way to reproduce > this exception within Java? Make Java think it is headless? > > Thanks, > Robert > > > > > > > On April 7, 2016 11:36:10 PM Robert Field wrote: > >> Nice. I'll push in the morning. >> >> -Robert >> >> >> On April 7, 2016 11:25:22 PM KUBOTA Yuji wrote: >> >>> Hi Robert, >>> >>> Thanks for comment. Certainly for users, "something happen" is very >>> unkind. >>> >>> I updated my patch to show the exception message: >>> http://cr.openjdk.java.net/~ykubota/8153716/webrev.01/ >>> >>> Thanks, >>> Yuji >>> >>> 2016-04-08 1:14 GMT+09:00 Robert Field : >>>> >>>> Yuji, >>>> >>>> Looks good, I wonder if showing the exception (or the exception message) >>>> would be useful, rather than just a mystery of it not launching? For >>>> example, seeing that it is headless. >>>> >>>> -Robert >>>> >>>> >>>> On 04/07/16 02:04, KUBOTA Yuji wrote: >>>>> >>>>> >>>>> I filed the proposal which reported at below: >>>>> http://mail.openjdk.java.net/pipermail/kulla-dev/2016-April/001305.html >>>>> >>>>> Bug: >>>>> https://bugs.openjdk.java.net/browse/JDK-8153716 >>>>> >>>>> Webrev: >>>>> http://cr.openjdk.java.net/~ykubota/8153716/webrev.00/ >>>>> >>>>> I'm an author, not committer, so I need sponsor. >>>>> Please review it. >>>>> >>>>> Thanks, >>>>> Yuji >>>> >>>> >>>> > > From jan.lahoda at oracle.com Fri Apr 8 13:02:04 2016 From: jan.lahoda at oracle.com (Jan Lahoda) Date: Fri, 8 Apr 2016 15:02:04 +0200 Subject: RFR (S) 8130450, 8139835: JShell: repeated source / Snippet.id() doc In-Reply-To: <56FB0431.4040504@oracle.com> References: <56FB0431.4040504@oracle.com> Message-ID: <5707ABCC.6020009@oracle.com> Seems OK to me. Jan On 30.3.2016 00:39, Robert Field wrote: > Bugs: > 8130450: JShell: events are not generated for repeated source > 8139835: JShell API: Snippet.id() doc -- specify: no meaning, dynamic > > Webrev: > http://cr.openjdk.java.net/~rfield/8130450.webrev/ > > Thanks, > Robert > From grigory.ptashko at gmail.com Fri Apr 8 20:33:26 2016 From: grigory.ptashko at gmail.com (Grigory Ptashko) Date: Fri, 8 Apr 2016 23:33:26 +0300 Subject: testing JShell (langtools/test/jdk/jshell)? Message-ID: <9604F8DB-5080-4403-B19E-E2489877FE6F@gmail.com> Hello. I'd like to know what is the proper way to test JShell. I mean to run all the tests that are in the langtools/test/jdk/jshell? I'm totally new to jdk development. This is how my usual process set up: 1. I edit the sources with Intellij IDEA. I launched "ant idea" in the langtools/make folder. And got the idea project which I se now. 2. Then I build the jdk with "make CONF=... images". I do it every time after editing sources. It turns out that I use Idea only for browsing and editing sources. 3. Then in the images folder I get the full JDK image which I deploy to ios and test it with my own app. So, where in my process (and how) must the tests be included? Btw, if it is possible I'd like to run only langtools/test/jdk/jshell tests. And not for the whole jdk. Thank you. -- Best regards, Grigory Ptashko +7 (916) 1489766 grigory.ptashko at gmail.com facebook.com/GrigoryPtashko From robert.field at oracle.com Sat Apr 9 03:13:15 2016 From: robert.field at oracle.com (Robert Field) Date: Fri, 08 Apr 2016 20:13:15 -0700 Subject: testing JShell (langtools/test/jdk/jshell)? In-Reply-To: <9604F8DB-5080-4403-B19E-E2489877FE6F@gmail.com> References: <9604F8DB-5080-4403-B19E-E2489877FE6F@gmail.com> Message-ID: <5708734B.9020709@oracle.com> Hi Grigory, You will need jtreg (Download jtreg/jtreg), get 4.2 http://openjdk.java.net/jtreg/ Attached is my personal script for running jshell tests. Which would need customization to your environment, at a minimum, JAVA_HOME would need to be updated. -Robert On 04/08/16 13:33, Grigory Ptashko wrote: > Hello. > > I'd like to know what is the proper way to test JShell. I mean to run all the > tests that are in the langtools/test/jdk/jshell? > I'm totally new to jdk development. > This is how my usual process set up: > > 1. I edit the sources with Intellij IDEA. I launched "ant idea" in the > langtools/make folder. And got the idea project which I se now. > > 2. Then I build the jdk with "make CONF=... images". I do it every time after > editing sources. It turns out that I use Idea only for browsing and editing > sources. > > 3. Then in the images folder I get the full JDK image which I deploy to ios and > test it with my own app. > > So, where in my process (and how) must the tests be included? > > Btw, if it is possible I'd like to run only langtools/test/jdk/jshell tests. And > not for the whole jdk. > > Thank you. > > -- > Best regards, > Grigory Ptashko > > +7 (916) 1489766 > grigory.ptashko at gmail.com > facebook.com/GrigoryPtashko > -------------- next part -------------- #! /bin/bash -x export CMD_JAVA_ROOT=$1 export BUILD_DIR="${CMD_JAVA_ROOT}/build" export TEST_DIR="${BUILD_DIR}/test" export LOG_DIR="${TEST_DIR}/log" export JAVA_HOME="${BUILD_DIR}/linux-x86_64-normal-server-release/images/jdk/" export PATH="${JAVA_HOME}/bin:${STD_PATH}" export JTREG=${JT_HOME}/bin/jtreg rm -rf ${TEST_DIR}_old2 mv ${TEST_DIR}_old1 ${TEST_DIR}_old2 mv ${TEST_DIR} ${TEST_DIR}_old1 mkdir -p ${LOG_DIR} which java | tee ${LOG_DIR}/whichJava.txt cd ${CMD_JAVA_ROOT}/langtools/test ${JTREG} -jdk:${JAVA_HOME} -r:${TEST_DIR}/JTlang/JTreport -w:${TEST_DIR}/JTlang/JTwork -verbose:all -enablesystemassertions -samevm jdk/jshell/ | tee ${LOG_DIR}/kulla.txt From robert.field at oracle.com Sat Apr 9 18:10:09 2016 From: robert.field at oracle.com (Robert Field) Date: Sat, 09 Apr 2016 11:10:09 -0700 Subject: Results: JShell user experience survey Message-ID: <57094581.1060405@oracle.com> Thank you all, again, for all the responses. We got 25 completed surveys. Here are the results (in a nice graphical format): https://www.surveymonkey.com/results/SM-N2CC9PCS/ My summary, including the "Other:" responses which I can't get it to show in the above view, is: On the question of some kind of feedback vs no feedback, feedback was the hands-down winner, getting 84% to 92%. Specifically: Both class/method questions: 88% Variable creation WITHOUT an initializer: 84% Assignment: 92% Expression/variable format opinions were more diverse. The top vote getting format was the concise arrow format An equal number suggested one of four formats that included the type. For variable creation WITHOUT an initializer, a consistent concise format using null was the winner (60%) vs a verbal format like class/method (20%). The JShell design isn't a democratic process, however, I would like the first implemented feedback that is designed/discussed (as opposed to the current arbitrary feedback) to follow the predominate positions taken on the survey. I will implement this soon. The high-level: All declarations (class, method, and variable) and all expressions give feedback. That feedback is concise. Where there is a value, it is shown. Selecting other feedback modes should be easy, e.g. -quiet: https://bugs.openjdk.java.net/browse/JDK-8151754 Some things to continue to consider: Having the feedback closer to the goal will help with final tuning. Showing type information (or not) has been actively discussed. There are times where it is quite useful. However, the type can be long and complex. As a third element it pushes the visual complexity hard. Should have some way to get type. Added: https://bugs.openjdk.java.net/browse/JDK-8153920 There was a suggestion that might unify the formats (or confuse things): method square(int) -> int Not sure how classes would be represented Thanks for the dial down feedback verbosity suggestion -- important to look at that again. If there were automatic ways to dial down feedback verbosity, that would be great, nothing clean/unsurprising has been suggested. Having the feedback mode persist between sessions (like the history) might be useful here. Where, as currently, the mode is set with, e.g.: /set feedback verbose How would that play with format/prompt setting? Maybe all configuration should persist -- I like that! Then predefined modes should be read-only /set clear -- would be needed A concern about an 80 character limit was raised. JShell has no line length limits -- that is your OS shell. Send me a note if that doesn't cover it. Thanks, Robert From robert.field at oracle.com Sat Apr 9 18:50:59 2016 From: robert.field at oracle.com (Robert Field) Date: Sat, 09 Apr 2016 11:50:59 -0700 Subject: RFR 8153716: JShell tool: should warn when failed to launch editor In-Reply-To: References: <57068758.5040408@oracle.com> <153f495c790.2784.4011f3a8741ca2aabce58b8b81f42d24@oracle.com> <153f4a027d0.2784.4011f3a8741ca2aabce58b8b81f42d24@oracle.com> Message-ID: <57094F13.6060107@oracle.com> Fix pushed! The link you provided lead me to the property. Which meant a test could be written with: System.setProperty("java.awt.headless", "true") -Robert On 04/08/16 01:49, KUBOTA Yuji wrote: > Sorry, I do not have an idea to reproduce within Java. I checked some > tests which may be related with headless, e.g., > jdk/test/java/awt/Toolkit/Headless/HeadlessToolkit.java. But they > require to run in headless mode. > > Thanks, > Yuji > > 2016-04-08 15:47 GMT+09:00 Robert Field : >> It will need a regression test, if possible. Is there a way to reproduce >> this exception within Java? Make Java think it is headless? >> >> Thanks, >> Robert >> >> >> >> >> >> >> On April 7, 2016 11:36:10 PM Robert Field wrote: >> >>> Nice. I'll push in the morning. >>> >>> -Robert >>> >>> >>> On April 7, 2016 11:25:22 PM KUBOTA Yuji wrote: >>> >>>> Hi Robert, >>>> >>>> Thanks for comment. Certainly for users, "something happen" is very >>>> unkind. >>>> >>>> I updated my patch to show the exception message: >>>> http://cr.openjdk.java.net/~ykubota/8153716/webrev.01/ >>>> >>>> Thanks, >>>> Yuji >>>> >>>> 2016-04-08 1:14 GMT+09:00 Robert Field : >>>>> Yuji, >>>>> >>>>> Looks good, I wonder if showing the exception (or the exception message) >>>>> would be useful, rather than just a mystery of it not launching? For >>>>> example, seeing that it is headless. >>>>> >>>>> -Robert >>>>> >>>>> >>>>> On 04/07/16 02:04, KUBOTA Yuji wrote: >>>>>> >>>>>> I filed the proposal which reported at below: >>>>>> http://mail.openjdk.java.net/pipermail/kulla-dev/2016-April/001305.html >>>>>> >>>>>> Bug: >>>>>> https://bugs.openjdk.java.net/browse/JDK-8153716 >>>>>> >>>>>> Webrev: >>>>>> http://cr.openjdk.java.net/~ykubota/8153716/webrev.00/ >>>>>> >>>>>> I'm an author, not committer, so I need sponsor. >>>>>> Please review it. >>>>>> >>>>>> Thanks, >>>>>> Yuji >>>>> >>>>> >> From robert.field at oracle.com Sun Apr 10 04:45:02 2016 From: robert.field at oracle.com (Robert Field) Date: Sat, 09 Apr 2016 21:45:02 -0700 Subject: RFR 8143955: JShell tool (UX): Output structure Message-ID: <5709DA4E.5010304@oracle.com> This is the new feedback definitions. Besides the configuration commands (embedded in the properties file), and a few output fix-ups, this is mostly lots of test changes, Bug: 8143955: JShell tool (UX): Output structure 8143956: JShell tool (UX): default prompts Webrev: http://cr.openjdk.java.net/~rfield/8143955.webrev/ Thanks, Robert From robert.field at oracle.com Sun Apr 10 05:13:50 2016 From: robert.field at oracle.com (Robert Field) Date: Sat, 09 Apr 2016 22:13:50 -0700 Subject: RFR 8143955: JShell tool (UX): Output structure Message-ID: <5709E10E.60809@oracle.com> This is the new feedback definitions. Besides the configuration commands (embedded in the properties file), and a few output fix-ups, this is mostly lots of test changes, Bug: 8143955: JShell tool (UX): Output structure 8143956: JShell tool (UX): default prompts Webrev: http://cr.openjdk.java.net/~rfield/8143955.webrev/ Thanks, Robert From grigory.ptashko at gmail.com Sun Apr 10 14:33:46 2016 From: grigory.ptashko at gmail.com (Grigory Ptashko) Date: Sun, 10 Apr 2016 17:33:46 +0300 Subject: testing JShell (langtools/test/jdk/jshell)? In-Reply-To: <5708734B.9020709@oracle.com> References: <9604F8DB-5080-4403-B19E-E2489877FE6F@gmail.com> <5708734B.9020709@oracle.com> Message-ID: <32B24618-9AEB-4BD5-85D4-790EF3DF3D01@gmail.com> Trying to run tests with the script I get the following error: /Users/macbook/work/jtreg/bin/jtreg -jdk:/Users/macbook/work/openjdk9/build/macosx-x86_64-normal-server-slowdebug/images/jdk/ -r:/Users/macbook/work/openjdk9/build/test/JTlang/JTreport -w:/Users/macbook/work/openjdk9/build/test/JTlang/JTwork -verbose:all -enablesystemassertions -samevm jdk/jshell/ Error: Unexpected exception occurred! java.lang.NumberFormatException: For input string: "ip" java.lang.NumberFormatException: For input string: "ip" at java.lang.NumberFormatException.forInputString(java.base at 9-internal/NumberFormatException.java:65) at java.lang.Integer.parseInt(java.base at 9-internal/Integer.java:695) at java.lang.Integer.parseInt(java.base at 9-internal/Integer.java:813) at com.sun.javatest.regtest.Version.getBuild(Version.java:186) at com.sun.javatest.regtest.Version.compareTo(Version.java:168) at com.sun.javatest.regtest.Main.run(Main.java:1091) at com.sun.javatest.regtest.Main.run(Main.java:1037) at com.sun.javatest.regtest.Main.main(Main.java:951) The openjdk9 sources are up-to-date and freshly built. What am I doing wrong? > On 9 ???. 2016 ?., at 6:13, Robert Field wrote: > > Hi Grigory, > > You will need jtreg (Download jtreg/jtreg), get 4.2 > > http://openjdk.java.net/jtreg/ > > Attached is my personal script for running jshell tests. Which would need customization to your environment, at a minimum, JAVA_HOME would need to be updated. > > -Robert > > On 04/08/16 13:33, Grigory Ptashko wrote: >> Hello. >> >> I'd like to know what is the proper way to test JShell. I mean to run all the >> tests that are in the langtools/test/jdk/jshell? >> I'm totally new to jdk development. >> This is how my usual process set up: >> >> 1. I edit the sources with Intellij IDEA. I launched "ant idea" in the >> langtools/make folder. And got the idea project which I se now. >> >> 2. Then I build the jdk with "make CONF=... images". I do it every time after >> editing sources. It turns out that I use Idea only for browsing and editing >> sources. >> >> 3. Then in the images folder I get the full JDK image which I deploy to ios and >> test it with my own app. >> >> So, where in my process (and how) must the tests be included? >> >> Btw, if it is possible I'd like to run only langtools/test/jdk/jshell tests. And >> not for the whole jdk. >> >> Thank you. >> >> -- >> Best regards, >> Grigory Ptashko >> >> +7 (916) 1489766 >> grigory.ptashko at gmail.com >> facebook.com/GrigoryPtashko >> > > -- Best regards, Grigory Ptashko +7 (916) 1489766 grigory.ptashko at gmail.com facebook.com/GrigoryPtashko From robert.field at oracle.com Mon Apr 11 05:14:04 2016 From: robert.field at oracle.com (Robert Field) Date: Sun, 10 Apr 2016 22:14:04 -0700 Subject: JShell: /set newmode ... vs /set mode ... Message-ID: <570B329C.6090300@oracle.com> A little question: I'm thinking I should have named the /set subcommand just "mode". From robert.field at oracle.com Mon Apr 11 07:22:07 2016 From: robert.field at oracle.com (Robert Field) Date: Mon, 11 Apr 2016 00:22:07 -0700 Subject: RFR (s) 8153551: jshell tool: no longer a mechanism to see current feedback modes Message-ID: <570B509F.1000101@oracle.com> Bug: https://bugs.openjdk.java.net/browse/JDK-8153551 Webrev: http://cr.openjdk.java.net/~rfield/8153551.webrev/ Thanks, Robert From kubota.yuji at gmail.com Mon Apr 11 12:00:50 2016 From: kubota.yuji at gmail.com (KUBOTA Yuji) Date: Mon, 11 Apr 2016 21:00:50 +0900 Subject: RFR 8153716: JShell tool: should warn when failed to launch editor In-Reply-To: <57094F13.6060107@oracle.com> References: <57068758.5040408@oracle.com> <153f495c790.2784.4011f3a8741ca2aabce58b8b81f42d24@oracle.com> <153f4a027d0.2784.4011f3a8741ca2aabce58b8b81f42d24@oracle.com> <57094F13.6060107@oracle.com> Message-ID: Ah, I had a misunderstand about this jvm option. Thank you for catching and adding test! I will make patch of other reported feedback. Thanks, Yuji 2016-04-10 3:50 GMT+09:00 Robert Field : > Fix pushed! > > The link you provided lead me to the property. Which meant a test could be > written with: > > System.setProperty("java.awt.headless", "true") > > -Robert > > > On 04/08/16 01:49, KUBOTA Yuji wrote: >> >> Sorry, I do not have an idea to reproduce within Java. I checked some >> tests which may be related with headless, e.g., >> jdk/test/java/awt/Toolkit/Headless/HeadlessToolkit.java. But they >> require to run in headless mode. >> >> Thanks, >> Yuji >> >> 2016-04-08 15:47 GMT+09:00 Robert Field : >>> >>> It will need a regression test, if possible. Is there a way to reproduce >>> this exception within Java? Make Java think it is headless? >>> >>> Thanks, >>> Robert >>> >>> >>> >>> >>> >>> >>> On April 7, 2016 11:36:10 PM Robert Field >>> wrote: >>> >>>> Nice. I'll push in the morning. >>>> >>>> -Robert >>>> >>>> >>>> On April 7, 2016 11:25:22 PM KUBOTA Yuji wrote: >>>> >>>>> Hi Robert, >>>>> >>>>> Thanks for comment. Certainly for users, "something happen" is very >>>>> unkind. >>>>> >>>>> I updated my patch to show the exception message: >>>>> http://cr.openjdk.java.net/~ykubota/8153716/webrev.01/ >>>>> >>>>> Thanks, >>>>> Yuji >>>>> >>>>> 2016-04-08 1:14 GMT+09:00 Robert Field : >>>>>> >>>>>> Yuji, >>>>>> >>>>>> Looks good, I wonder if showing the exception (or the exception >>>>>> message) >>>>>> would be useful, rather than just a mystery of it not launching? For >>>>>> example, seeing that it is headless. >>>>>> >>>>>> -Robert >>>>>> >>>>>> >>>>>> On 04/07/16 02:04, KUBOTA Yuji wrote: >>>>>>> >>>>>>> >>>>>>> I filed the proposal which reported at below: >>>>>>> >>>>>>> http://mail.openjdk.java.net/pipermail/kulla-dev/2016-April/001305.html >>>>>>> >>>>>>> Bug: >>>>>>> https://bugs.openjdk.java.net/browse/JDK-8153716 >>>>>>> >>>>>>> Webrev: >>>>>>> http://cr.openjdk.java.net/~ykubota/8153716/webrev.00/ >>>>>>> >>>>>>> I'm an author, not committer, so I need sponsor. >>>>>>> Please review it. >>>>>>> >>>>>>> Thanks, >>>>>>> Yuji >>>>>> >>>>>> >>>>>> >>> > From grigory.ptashko at gmail.com Mon Apr 11 12:10:27 2016 From: grigory.ptashko at gmail.com (Grigory Ptashko) Date: Mon, 11 Apr 2016 15:10:27 +0300 Subject: RESULT_EXCEPTION and RESULT_CORRALLED in ExecutionControl Message-ID: <74E62854-DB3B-4CCA-9E96-38F601D677E8@gmail.com> Hello. I need some explanation on ExecutionControl. Namely, what is the difference between RESULT_EXCEPTION and RESULT_CORRALLED? Why is RESULT_EXCEPTION not enough? Thank you. -- Best regards, Grigory Ptashko +7 (916) 1489766 grigory.ptashko at gmail.com facebook.com/GrigoryPtashko From robert.field at oracle.com Mon Apr 11 15:45:53 2016 From: robert.field at oracle.com (Robert Field) Date: Mon, 11 Apr 2016 08:45:53 -0700 Subject: RESULT_EXCEPTION and RESULT_CORRALLED in ExecutionControl In-Reply-To: <74E62854-DB3B-4CCA-9E96-38F601D677E8@gmail.com> References: <74E62854-DB3B-4CCA-9E96-38F601D677E8@gmail.com> Message-ID: <570BC6B1.3000304@oracle.com> RESULT_CORRALLED is for attempts to executed corralled code (that is code with unresolved references), isn't handled like a user exception. Is passed different arguments. -Robert On 04/11/16 05:10, Grigory Ptashko wrote: > Hello. > > I need some explanation on ExecutionControl. > Namely, what is the difference between > > RESULT_EXCEPTION and RESULT_CORRALLED? > > Why is RESULT_EXCEPTION not enough? > > Thank you. > > -- > Best regards, > Grigory Ptashko > > +7 (916) 1489766 > grigory.ptashko at gmail.com > facebook.com/GrigoryPtashko > From jonathan.gibbons at oracle.com Mon Apr 11 16:34:23 2016 From: jonathan.gibbons at oracle.com (Jonathan Gibbons) Date: Mon, 11 Apr 2016 09:34:23 -0700 Subject: testing JShell (langtools/test/jdk/jshell)? In-Reply-To: <5708734B.9020709@oracle.com> References: <9604F8DB-5080-4403-B19E-E2489877FE6F@gmail.com> <5708734B.9020709@oracle.com> Message-ID: <570BD20F.7070307@oracle.com> Robert, Your script uses a defunct option, -samevm. That feature (samevm mode) was removed a while back, and the option is currently just an alias for its replacement, -agentvm. You might want to change your script to use the new option. -- Jon On 04/08/2016 08:13 PM, Robert Field wrote: > Hi Grigory, > > You will need jtreg (Download jtreg/jtreg), get 4.2 > > http://openjdk.java.net/jtreg/ > > Attached is my personal script for running jshell tests. Which would > need customization to your environment, at a minimum, JAVA_HOME would > need to be updated. > > -Robert > > On 04/08/16 13:33, Grigory Ptashko wrote: >> Hello. >> >> I'd like to know what is the proper way to test JShell. I mean to run >> all the >> tests that are in the langtools/test/jdk/jshell? >> I'm totally new to jdk development. >> This is how my usual process set up: >> >> 1. I edit the sources with Intellij IDEA. I launched "ant idea" in the >> langtools/make folder. And got the idea project which I se now. >> >> 2. Then I build the jdk with "make CONF=... images". I do it every >> time after >> editing sources. It turns out that I use Idea only for browsing and >> editing >> sources. >> >> 3. Then in the images folder I get the full JDK image which I deploy >> to ios and >> test it with my own app. >> >> So, where in my process (and how) must the tests be included? >> >> Btw, if it is possible I'd like to run only langtools/test/jdk/jshell >> tests. And >> not for the whole jdk. >> >> Thank you. >> >> -- >> Best regards, >> Grigory Ptashko >> >> +7 (916) 1489766 >> grigory.ptashko at gmail.com >> facebook.com/GrigoryPtashko >> > From robert.field at oracle.com Mon Apr 11 16:53:54 2016 From: robert.field at oracle.com (Robert Field) Date: Mon, 11 Apr 2016 09:53:54 -0700 Subject: RFR 8153716: JShell tool: should warn when failed to launch editor In-Reply-To: References: <57068758.5040408@oracle.com> <153f495c790.2784.4011f3a8741ca2aabce58b8b81f42d24@oracle.com> <153f4a027d0.2784.4011f3a8741ca2aabce58b8b81f42d24@oracle.com> <57094F13.6060107@oracle.com> Message-ID: <154063e68d0.2784.4011f3a8741ca2aabce58b8b81f42d24@oracle.com> Thanks for the fix! On April 11, 2016 5:00:52 AM KUBOTA Yuji wrote: > Ah, I had a misunderstand about this jvm option. > Thank you for catching and adding test! > > I will make patch of other reported feedback. > > Thanks, > Yuji > > 2016-04-10 3:50 GMT+09:00 Robert Field : >> Fix pushed! >> >> The link you provided lead me to the property. Which meant a test could be >> written with: >> >> System.setProperty("java.awt.headless", "true") >> >> -Robert >> >> >> On 04/08/16 01:49, KUBOTA Yuji wrote: >>> >>> Sorry, I do not have an idea to reproduce within Java. I checked some >>> tests which may be related with headless, e.g., >>> jdk/test/java/awt/Toolkit/Headless/HeadlessToolkit.java. But they >>> require to run in headless mode. >>> >>> Thanks, >>> Yuji >>> >>> 2016-04-08 15:47 GMT+09:00 Robert Field : >>>> >>>> It will need a regression test, if possible. Is there a way to reproduce >>>> this exception within Java? Make Java think it is headless? >>>> >>>> Thanks, >>>> Robert >>>> >>>> >>>> >>>> >>>> >>>> >>>> On April 7, 2016 11:36:10 PM Robert Field >>>> wrote: >>>> >>>>> Nice. I'll push in the morning. >>>>> >>>>> -Robert >>>>> >>>>> >>>>> On April 7, 2016 11:25:22 PM KUBOTA Yuji wrote: >>>>> >>>>>> Hi Robert, >>>>>> >>>>>> Thanks for comment. Certainly for users, "something happen" is very >>>>>> unkind. >>>>>> >>>>>> I updated my patch to show the exception message: >>>>>> http://cr.openjdk.java.net/~ykubota/8153716/webrev.01/ >>>>>> >>>>>> Thanks, >>>>>> Yuji >>>>>> >>>>>> 2016-04-08 1:14 GMT+09:00 Robert Field : >>>>>>> >>>>>>> Yuji, >>>>>>> >>>>>>> Looks good, I wonder if showing the exception (or the exception >>>>>>> message) >>>>>>> would be useful, rather than just a mystery of it not launching? For >>>>>>> example, seeing that it is headless. >>>>>>> >>>>>>> -Robert >>>>>>> >>>>>>> >>>>>>> On 04/07/16 02:04, KUBOTA Yuji wrote: >>>>>>>> >>>>>>>> >>>>>>>> I filed the proposal which reported at below: >>>>>>>> >>>>>>>> http://mail.openjdk.java.net/pipermail/kulla-dev/2016-April/001305.html >>>>>>>> >>>>>>>> Bug: >>>>>>>> https://bugs.openjdk.java.net/browse/JDK-8153716 >>>>>>>> >>>>>>>> Webrev: >>>>>>>> http://cr.openjdk.java.net/~ykubota/8153716/webrev.00/ >>>>>>>> >>>>>>>> I'm an author, not committer, so I need sponsor. >>>>>>>> Please review it. >>>>>>>> >>>>>>>> Thanks, >>>>>>>> Yuji >>>>>>> >>>>>>> >>>>>>> >>>> >> From grigory.ptashko at gmail.com Mon Apr 11 20:11:13 2016 From: grigory.ptashko at gmail.com (Grigory Ptashko) Date: Mon, 11 Apr 2016 23:11:13 +0300 Subject: RESULT_EXCEPTION and RESULT_CORRALLED in ExecutionControl In-Reply-To: <570BC6B1.3000304@oracle.com> References: <74E62854-DB3B-4CCA-9E96-38F601D677E8@gmail.com> <570BC6B1.3000304@oracle.com> Message-ID: <8FC54844-518C-4E13-867A-C7B338F781D5@gmail.com> Do I understand it right that this is the snippet ?compile time? exception and is thrown only when a snippet cannot be compiled? > On 11 ???. 2016 ?., at 18:45, Robert Field wrote: > > RESULT_CORRALLED is for attempts to executed corralled code (that is code with unresolved references), isn't handled like a user exception. Is passed different arguments. > > -Robert > > On 04/11/16 05:10, Grigory Ptashko wrote: >> Hello. >> >> I need some explanation on ExecutionControl. >> Namely, what is the difference between >> >> RESULT_EXCEPTION and RESULT_CORRALLED? >> >> Why is RESULT_EXCEPTION not enough? >> >> Thank you. >> >> -- >> Best regards, >> Grigory Ptashko >> >> +7 (916) 1489766 >> grigory.ptashko at gmail.com >> facebook.com/GrigoryPtashko >> > -- Best regards, Grigory Ptashko +7 (916) 1489766 grigory.ptashko at gmail.com facebook.com/GrigoryPtashko From robert.field at oracle.com Mon Apr 11 20:23:35 2016 From: robert.field at oracle.com (Robert Field) Date: Mon, 11 Apr 2016 13:23:35 -0700 Subject: RESULT_EXCEPTION and RESULT_CORRALLED in ExecutionControl In-Reply-To: <8FC54844-518C-4E13-867A-C7B338F781D5@gmail.com> References: <74E62854-DB3B-4CCA-9E96-38F601D677E8@gmail.com> <570BC6B1.3000304@oracle.com> <8FC54844-518C-4E13-867A-C7B338F781D5@gmail.com> Message-ID: <570C07C7.7090604@oracle.com> Corralling -- If I enter: void m() { f(); } and f() isn't defined, I'll get: | Added method m(), however, it cannot be invoked until method f() is declared under the sheets that means it has been compiled as: void m() { throw new RemoteResolutionException(46); } Where , for example,46 identifies the snippet for method m(). Other code can now happily reference m(): void mm() { m(); m(); } But if, at runtime, m() gets executed, it will throw the RemoteResolutionException, which, in turn, will cause RESULT_CORRALLED to be sent across the wire (with the id info). So that it will be reported as: -> mm() | Attempted to call method m() which cannot be invoked until method f() is declared ExecutionControl deals only with execution never compilation. -Robert On 04/11/16 13:11, Grigory Ptashko wrote: > Do I understand it right that this is the snippet ?compile time? exception and is > thrown only when a snippet cannot be compiled? > >> On 11 ???. 2016 ?., at 18:45, Robert Field wrote: >> >> RESULT_CORRALLED is for attempts to executed corralled code (that is code with unresolved references), isn't handled like a user exception. Is passed different arguments. >> >> -Robert >> >> On 04/11/16 05:10, Grigory Ptashko wrote: >>> Hello. >>> >>> I need some explanation on ExecutionControl. >>> Namely, what is the difference between >>> >>> RESULT_EXCEPTION and RESULT_CORRALLED? >>> >>> Why is RESULT_EXCEPTION not enough? >>> >>> Thank you. >>> >>> -- >>> Best regards, >>> Grigory Ptashko >>> >>> +7 (916) 1489766 >>> grigory.ptashko at gmail.com >>> facebook.com/GrigoryPtashko >>> > > -- > Best regards, > Grigory Ptashko > > +7 (916) 1489766 > grigory.ptashko at gmail.com > facebook.com/GrigoryPtashko > From grigory.ptashko at gmail.com Mon Apr 11 20:26:15 2016 From: grigory.ptashko at gmail.com (Grigory Ptashko) Date: Mon, 11 Apr 2016 23:26:15 +0300 Subject: RESULT_EXCEPTION and RESULT_CORRALLED in ExecutionControl In-Reply-To: <570C07C7.7090604@oracle.com> References: <74E62854-DB3B-4CCA-9E96-38F601D677E8@gmail.com> <570BC6B1.3000304@oracle.com> <8FC54844-518C-4E13-867A-C7B338F781D5@gmail.com> <570C07C7.7090604@oracle.com> Message-ID: <0FF2E4B7-0D5B-4C6D-BB7D-A9297C4D08BB@gmail.com> I see. I actually meant that but could not say it in a correct way. That?s why I said "compile time? in quotes. Thank you! > On 11 ???. 2016 ?., at 23:23, Robert Field wrote: > > Corralling -- > > If I enter: > > void m() { f(); } > > and f() isn't defined, I'll get: > > | Added method m(), however, it cannot be invoked until method f() is declared > > under the sheets that means it has been compiled as: > > void m() { throw new RemoteResolutionException(46); } > > Where , for example,46 identifies the snippet for method m(). > > Other code can now happily reference m(): > > void mm() { m(); m(); } > > But if, at runtime, m() gets executed, it will throw the RemoteResolutionException, which, in turn, will cause RESULT_CORRALLED to be sent across the wire (with the id info). So that it will be reported as: > > -> mm() > | Attempted to call method m() which cannot be invoked until method f() is declared > > ExecutionControl deals only with execution never compilation. > > -Robert > > > On 04/11/16 13:11, Grigory Ptashko wrote: >> Do I understand it right that this is the snippet ?compile time? exception and is >> thrown only when a snippet cannot be compiled? >> >>> On 11 ???. 2016 ?., at 18:45, Robert Field wrote: >>> >>> RESULT_CORRALLED is for attempts to executed corralled code (that is code with unresolved references), isn't handled like a user exception. Is passed different arguments. >>> >>> -Robert >>> >>> On 04/11/16 05:10, Grigory Ptashko wrote: >>>> Hello. >>>> >>>> I need some explanation on ExecutionControl. >>>> Namely, what is the difference between >>>> >>>> RESULT_EXCEPTION and RESULT_CORRALLED? >>>> >>>> Why is RESULT_EXCEPTION not enough? >>>> >>>> Thank you. >>>> >>>> -- >>>> Best regards, >>>> Grigory Ptashko >>>> >>>> +7 (916) 1489766 >>>> grigory.ptashko at gmail.com >>>> facebook.com/GrigoryPtashko >>>> >> >> -- >> Best regards, >> Grigory Ptashko >> >> +7 (916) 1489766 >> grigory.ptashko at gmail.com >> facebook.com/GrigoryPtashko >> > -- Best regards, Grigory Ptashko +7 (916) 1489766 grigory.ptashko at gmail.com facebook.com/GrigoryPtashko From grigory.ptashko at gmail.com Mon Apr 11 22:30:11 2016 From: grigory.ptashko at gmail.com (Grigory Ptashko) Date: Tue, 12 Apr 2016 01:30:11 +0300 Subject: readAndReportExecutionResult() in the ExecutionControl does not actually throw ClassNotFoundException Message-ID: <85DF1A2F-43E5-44DD-8E93-8597FB5C96C2@gmail.com> Hello. Studying the jshell sources I noticed that the method readAndReportExecutionResult() in the ExecutionControl class does not actually throw ClassNotFoundException as it is declared. The reason I?m writing about it is that this throws ClassNotFoundException confused me when I was trying to understand how the interaction between the ExecutionControl and the RemoteAgent is being carried out. In my opinion - a developer who just started to dive into sources - such subtle things can lead the understanding in a wrong way. I would remove it. Does anyone can comment on this? Thank you. -- Best regards, Grigory Ptashko +7 (916) 1489766 grigory.ptashko at gmail.com facebook.com/GrigoryPtashko From grigory.ptashko at gmail.com Tue Apr 12 08:44:18 2016 From: grigory.ptashko at gmail.com (Grigory Ptashko) Date: Tue, 12 Apr 2016 11:44:18 +0300 Subject: running langtools/test/jdk/jshell tests - 3 tests with errors and 3 ignored Message-ID: Hello. I?ve got an up-to-date and freshly built jdk9. I?m running tests in langtools/test/jdk/jshell and end with 6 tests with errors: == JT Harness : Tests that had errors Tests are grouped by their final status message. Agent error: java.lang.Exception: Agent timed out with a timeout of 120 seconds; check console log for any additional details jdk/jshell/KullaCompletenessStressTest.java: Test SourceCodeAnalysis jdk/jshell/ReplaceTest.java: Test of Snippet redefinition and replacement. jdk/jshell/ToolFormatTest.java: Tests for output customization Test ignored: 8080843 jdk/jshell/ExternalEditorTest.java: Testing external editor. Test ignored: 8139872 jdk/jshell/EditorPadTest.java: Testing built-in editor. Test ignored: 8139873 jdk/jshell/ToolBasicTest.java: Tests for Basic tests for REPL tool == Is this normal? I?m attaching 3 reports for first three tests. Maybe this can help. -------------- next part -------------- -- Best regards, Grigory Ptashko +7 (916) 1489766 grigory.ptashko at gmail.com facebook.com/GrigoryPtashko From jan.lahoda at oracle.com Tue Apr 12 17:46:58 2016 From: jan.lahoda at oracle.com (Jan Lahoda) Date: Tue, 12 Apr 2016 19:46:58 +0200 Subject: RFR 8143955: JShell tool (UX): Output structure In-Reply-To: <5709E10E.60809@oracle.com> References: <5709E10E.60809@oracle.com> Message-ID: <570D3492.2050408@oracle.com> Overall, seems OK. One question: why is e.g. ToolSimpleTest using NL = System.getProperty("line.separator"); instead of '\n'? AFAIK, using '\n' as the newline should be OK on all platforms, as the output is normalized from System.getProperty("line.separator") to '\n' (see ReplToolTesting.normalizeLineEndings). Jan On 10.4.2016 07:13, Robert Field wrote: > This is the new feedback definitions. > Besides the configuration commands (embedded in the properties file), > and a few output fix-ups, this is mostly lots of test changes, > > Bug: > 8143955: JShell tool (UX): Output structure > 8143956: JShell tool (UX): default prompts > > Webrev: > http://cr.openjdk.java.net/~rfield/8143955.webrev/ > > Thanks, > Robert > From robert.field at oracle.com Wed Apr 13 07:14:31 2016 From: robert.field at oracle.com (Robert Field) Date: Wed, 13 Apr 2016 00:14:31 -0700 Subject: RFR 8143955: JShell tool (UX): Output structure In-Reply-To: <570D3492.2050408@oracle.com> References: <5709E10E.60809@oracle.com> <570D3492.2050408@oracle.com> Message-ID: <1540e78afd8.2784.4011f3a8741ca2aabce58b8b81f42d24@oracle.com> Thanks. Reverted the NL changes. Pushed. -Robert On April 12, 2016 10:47:01 AM Jan Lahoda wrote: > Overall, seems OK. One question: why is e.g. ToolSimpleTest using NL = > System.getProperty("line.separator"); instead of '\n'? AFAIK, using '\n' > as the newline should be OK on all platforms, as the output is > normalized from System.getProperty("line.separator") to '\n' (see > ReplToolTesting.normalizeLineEndings). > > Jan > > On 10.4.2016 07:13, Robert Field wrote: >> This is the new feedback definitions. >> Besides the configuration commands (embedded in the properties file), >> and a few output fix-ups, this is mostly lots of test changes, >> >> Bug: >> 8143955: JShell tool (UX): Output structure >> 8143956: JShell tool (UX): default prompts >> >> Webrev: >> http://cr.openjdk.java.net/~rfield/8143955.webrev/ >> >> Thanks, >> Robert >> From weijun.wang at oracle.com Wed Apr 13 09:22:02 2016 From: weijun.wang at oracle.com (Wang Weijun) Date: Wed, 13 Apr 2016 17:22:02 +0800 Subject: How do I import a sun.* class in jshell Message-ID: <1DB2C016-7A0D-4D75-B1FC-12A9F6C6AD9F@oracle.com> $ jshell -J-XaddExports:java.base/sun.security.provider=ALL-UNNAMED | Welcome to JShell -- Version 9-internal | Type /help for help -> import sun.security.provider.SecureRandom | Error: | package sun.security.provider does not exist | import sun.security.provider.SecureRandom; | ^--------------------------------^ Thanks Max From benjamin.john.evans at gmail.com Wed Apr 13 14:43:57 2016 From: benjamin.john.evans at gmail.com (Ben Evans) Date: Wed, 13 Apr 2016 15:43:57 +0100 Subject: How do I import a sun.* class in jshell In-Reply-To: <1DB2C016-7A0D-4D75-B1FC-12A9F6C6AD9F@oracle.com> References: <1DB2C016-7A0D-4D75-B1FC-12A9F6C6AD9F@oracle.com> Message-ID: Hi Max, This is being stopped by the Java 9 module system, as sun.* is an internal package. Is there a flag that can be used to override this in jshell? Do we think such a feature would even be desirable? Thanks, Ben On Wed, Apr 13, 2016 at 10:22 AM, Wang Weijun wrote: > > $ jshell -J-XaddExports:java.base/sun.security.provider=ALL-UNNAMED > | Welcome to JShell -- Version 9-internal > | Type /help for help > > -> import sun.security.provider.SecureRandom > | Error: > | package sun.security.provider does not exist > | import sun.security.provider.SecureRandom; > | ^--------------------------------^ > > Thanks > Max > From weijun.wang at oracle.com Wed Apr 13 15:12:21 2016 From: weijun.wang at oracle.com (Wang Weijun) Date: Wed, 13 Apr 2016 23:12:21 +0800 Subject: How do I import a sun.* class in jshell In-Reply-To: References: <1DB2C016-7A0D-4D75-B1FC-12A9F6C6AD9F@oracle.com> Message-ID: > On Apr 13, 2016, at 10:43 PM, Ben Evans wrote: > > Hi Max, > > This is being stopped by the Java 9 module system, as sun.* is an > internal package. That's why I added -J-XaddExports:java.base/sun.security.provider=ALL-UNNAMED but it doesn't work. > > Is there a flag that can be used to override this in jshell? Do we > think such a feature would even be desirable? Personally I find it useful if I am either authoring those internal classes or using them when implementing a public API. Thanks Max > > Thanks, > > Ben > > > On Wed, Apr 13, 2016 at 10:22 AM, Wang Weijun wrote: >> >> $ jshell -J-XaddExports:java.base/sun.security.provider=ALL-UNNAMED >> | Welcome to JShell -- Version 9-internal >> | Type /help for help >> >> -> import sun.security.provider.SecureRandom >> | Error: >> | package sun.security.provider does not exist >> | import sun.security.provider.SecureRandom; >> | ^--------------------------------^ >> >> Thanks >> Max >> From robert.field at oracle.com Fri Apr 15 21:25:26 2016 From: robert.field at oracle.com (Robert Field) Date: Fri, 15 Apr 2016 14:25:26 -0700 Subject: readAndReportExecutionResult() in the ExecutionControl does not actually throw ClassNotFoundException In-Reply-To: <85DF1A2F-43E5-44DD-8E93-8597FB5C96C2@gmail.com> References: <85DF1A2F-43E5-44DD-8E93-8597FB5C96C2@gmail.com> Message-ID: <57115C46.1070307@oracle.com> Thank you, Grigory. Created: https://bugs.openjdk.java.net/browse/JDK-8154377 -Robert On 04/11/16 15:30, Grigory Ptashko wrote: > Hello. > > Studying the jshell sources I noticed that the method readAndReportExecutionResult() > in the ExecutionControl class does not actually throw ClassNotFoundException as it is > declared. > The reason I?m writing about it is that this throws ClassNotFoundException confused > me when I was trying to understand how the interaction between the ExecutionControl and > the RemoteAgent is being carried out. > In my opinion - a developer who just started to dive into sources - such subtle things > can lead the understanding in a wrong way. I would remove it. > Does anyone can comment on this? > > Thank you. > > -- > Best regards, > Grigory Ptashko > > +7 (916) 1489766 > grigory.ptashko at gmail.com > facebook.com/GrigoryPtashko > From robert.field at oracle.com Mon Apr 18 21:37:58 2016 From: robert.field at oracle.com (Robert Field) Date: Mon, 18 Apr 2016 14:37:58 -0700 Subject: RFR 8154485: JShell: infrastructure for multi-Snippet class wrappers Message-ID: <571553B6.8050100@oracle.com> Bugs: https://bugs.openjdk.java.net/browse/JDK-8154485 https://bugs.openjdk.java.net/browse/JDK-8154377 Webrev: http://cr.openjdk.java.net/~rfield/8154485.webrev/ Thanks, Robert From robert.field at oracle.com Wed Apr 20 02:35:43 2016 From: robert.field at oracle.com (Robert Field) Date: Tue, 19 Apr 2016 19:35:43 -0700 (PDT) Subject: RFR (xs) 8154445: JShell: Drop residual use of addReads from jshell Message-ID: <5716EAFF.9030109@oracle.com> Bug: https://bugs.openjdk.java.net/browse/JDK-8154445 Webrev: http://cr.openjdk.java.net/~rfield/8154445.webrev/ Thanks, Robert From robert.field at oracle.com Wed Apr 20 04:17:19 2016 From: robert.field at oracle.com (Robert Field) Date: Tue, 19 Apr 2016 21:17:19 -0700 Subject: RFR 8151754/8150382: jshell tool command options: -R -feedback -q -qq -v and supporting API Message-ID: <571702CF.8070805@oracle.com> Bugs: 8150382: JShell API: Allow setting remote JVM arguments https://bugs.openjdk.java.net/browse/JDK-8150382 8151754: jshell tool: add command line options for setting feedback mode https://bugs.openjdk.java.net/browse/JDK-8151754 webrev: http://cr.openjdk.java.net/~rfield/8150382.webrev/ Thanks, Robert From robert.field at oracle.com Wed Apr 20 04:30:35 2016 From: robert.field at oracle.com (Robert Field) Date: Tue, 19 Apr 2016 21:30:35 -0700 Subject: How do I import a sun.* class in jshell In-Reply-To: References: <1DB2C016-7A0D-4D75-B1FC-12A9F6C6AD9F@oracle.com> Message-ID: <571705EB.9060007@oracle.com> I've created: https://bugs.openjdk.java.net/browse/JDK-8154714 Thanks, Robert On 04/13/16 08:12, Wang Weijun wrote: >> On Apr 13, 2016, at 10:43 PM, Ben Evans wrote: >> >> Hi Max, >> >> This is being stopped by the Java 9 module system, as sun.* is an >> internal package. > That's why I added -J-XaddExports:java.base/sun.security.provider=ALL-UNNAMED but it doesn't work. > >> Is there a flag that can be used to override this in jshell? Do we >> think such a feature would even be desirable? > Personally I find it useful if I am either authoring those internal classes or using them when implementing a public API. > > Thanks > Max > >> Thanks, >> >> Ben >> >> >> On Wed, Apr 13, 2016 at 10:22 AM, Wang Weijun wrote: >>> $ jshell -J-XaddExports:java.base/sun.security.provider=ALL-UNNAMED >>> | Welcome to JShell -- Version 9-internal >>> | Type /help for help >>> >>> -> import sun.security.provider.SecureRandom >>> | Error: >>> | package sun.security.provider does not exist >>> | import sun.security.provider.SecureRandom; >>> | ^--------------------------------^ >>> >>> Thanks >>> Max >>> From Alan.Bateman at oracle.com Wed Apr 20 10:04:29 2016 From: Alan.Bateman at oracle.com (Alan Bateman) Date: Wed, 20 Apr 2016 11:04:29 +0100 Subject: RFR (xs) 8154445: JShell: Drop residual use of addReads from jshell In-Reply-To: <5716EAFF.9030109@oracle.com> References: <5716EAFF.9030109@oracle.com> Message-ID: <5717542D.2060506@oracle.com> On 20/04/2016 03:35, Robert Field wrote: > Bug: > https://bugs.openjdk.java.net/browse/JDK-8154445 > > Webrev: > http://cr.openjdk.java.net/~rfield/8154445.webrev/ This looks okay to me. -Alan From kumar.x.srinivasan at oracle.com Wed Apr 20 12:59:33 2016 From: kumar.x.srinivasan at oracle.com (Kumar Srinivasan) Date: Wed, 20 Apr 2016 05:59:33 -0700 Subject: RFR (xs) 8154445: JShell: Drop residual use of addReads from jshell In-Reply-To: <5717542D.2060506@oracle.com> References: <5716EAFF.9030109@oracle.com> <5717542D.2060506@oracle.com> Message-ID: <57177D35.6080600@oracle.com> Looks good. Kumar > > > On 20/04/2016 03:35, Robert Field wrote: >> Bug: >> https://bugs.openjdk.java.net/browse/JDK-8154445 >> >> Webrev: >> http://cr.openjdk.java.net/~rfield/8154445.webrev/ > This looks okay to me. > > -Alan From jan.lahoda at oracle.com Wed Apr 20 13:30:30 2016 From: jan.lahoda at oracle.com (Jan Lahoda) Date: Wed, 20 Apr 2016 15:30:30 +0200 Subject: RFR 8151754/8150382: jshell tool command options: -R -feedback -q -qq -v and supporting API In-Reply-To: <571702CF.8070805@oracle.com> References: <571702CF.8070805@oracle.com> Message-ID: <57178476.2090206@oracle.com> Since the JShell.java change is an API, I'd suggest to use: public Builder remoteVMOptions(String... options) Where each element of the array would be an actual option, even if it included a space. I am not sure if an option with a space would currently in practice work when doing the JDI launch, but I think the API should be open to options like that. Otherwise, looks OK to me. Jan On 20.4.2016 06:17, Robert Field wrote: > Bugs: > 8150382: JShell API: Allow setting remote JVM arguments > https://bugs.openjdk.java.net/browse/JDK-8150382 > > 8151754: jshell tool: add command line options for setting feedback > mode > https://bugs.openjdk.java.net/browse/JDK-8151754 > > webrev: > http://cr.openjdk.java.net/~rfield/8150382.webrev/ > > Thanks, > Robert > From jan.lahoda at oracle.com Wed Apr 20 15:03:39 2016 From: jan.lahoda at oracle.com (Jan Lahoda) Date: Wed, 20 Apr 2016 17:03:39 +0200 Subject: RFR (s) 8153551: jshell tool: no longer a mechanism to see current feedback modes In-Reply-To: <570B509F.1000101@oracle.com> References: <570B509F.1000101@oracle.com> Message-ID: <57179A4B.2030409@oracle.com> Seems OK to me. Jan On 11.4.2016 09:22, Robert Field wrote: > Bug: > https://bugs.openjdk.java.net/browse/JDK-8153551 > > Webrev: > http://cr.openjdk.java.net/~rfield/8153551.webrev/ > > Thanks, > Robert > > From robert.field at oracle.com Thu Apr 21 00:15:34 2016 From: robert.field at oracle.com (Robert Field) Date: Wed, 20 Apr 2016 17:15:34 -0700 Subject: RFR 8151754/8150382: jshell tool command options: -R -feedback -q -qq -v and supporting API In-Reply-To: <57178476.2090206@oracle.com> References: <571702CF.8070805@oracle.com> <57178476.2090206@oracle.com> Message-ID: <57181BA6.3000709@oracle.com> Thanks Jan, I've changed to allow explicit multiple options vs whitespace separated: http://cr.openjdk.java.net/~rfield/8150382v2.webrev/ -Robert On 04/20/16 06:30, Jan Lahoda wrote: > Since the JShell.java change is an API, I'd suggest to use: > > public Builder remoteVMOptions(String... options) > > Where each element of the array would be an actual option, even if it > included a space. I am not sure if an option with a space would > currently in practice work when doing the JDI launch, but I think the > API should be open to options like that. > > Otherwise, looks OK to me. > > Jan > > On 20.4.2016 06:17, Robert Field wrote: >> Bugs: >> 8150382: JShell API: Allow setting remote JVM arguments >> https://bugs.openjdk.java.net/browse/JDK-8150382 >> >> 8151754: jshell tool: add command line options for setting feedback >> mode >> https://bugs.openjdk.java.net/browse/JDK-8151754 >> >> webrev: >> http://cr.openjdk.java.net/~rfield/8150382.webrev/ >> >> Thanks, >> Robert >> From jan.lahoda at oracle.com Thu Apr 21 10:51:41 2016 From: jan.lahoda at oracle.com (Jan Lahoda) Date: Thu, 21 Apr 2016 12:51:41 +0200 Subject: RFR 8151754/8150382: jshell tool command options: -R -feedback -q -qq -v and supporting API In-Reply-To: <57181BA6.3000709@oracle.com> References: <571702CF.8070805@oracle.com> <57178476.2090206@oracle.com> <57181BA6.3000709@oracle.com> Message-ID: <5718B0BD.3020606@oracle.com> Looks OK. Jan On 21.4.2016 02:15, Robert Field wrote: > Thanks Jan, > > I've changed to allow explicit multiple options vs whitespace separated: > http://cr.openjdk.java.net/~rfield/8150382v2.webrev/ > > -Robert > > On 04/20/16 06:30, Jan Lahoda wrote: >> Since the JShell.java change is an API, I'd suggest to use: >> >> public Builder remoteVMOptions(String... options) >> >> Where each element of the array would be an actual option, even if it >> included a space. I am not sure if an option with a space would >> currently in practice work when doing the JDI launch, but I think the >> API should be open to options like that. >> >> Otherwise, looks OK to me. >> >> Jan >> >> On 20.4.2016 06:17, Robert Field wrote: >>> Bugs: >>> 8150382: JShell API: Allow setting remote JVM arguments >>> https://bugs.openjdk.java.net/browse/JDK-8150382 >>> >>> 8151754: jshell tool: add command line options for setting feedback >>> mode >>> https://bugs.openjdk.java.net/browse/JDK-8151754 >>> >>> webrev: >>> http://cr.openjdk.java.net/~rfield/8150382.webrev/ >>> >>> Thanks, >>> Robert >>> > From robert.field at oracle.com Fri Apr 22 04:37:57 2016 From: robert.field at oracle.com (Robert Field) Date: Thu, 21 Apr 2016 21:37:57 -0700 Subject: RFR 8139837: JShell API: make a common JShellException Message-ID: <5719AAA5.2050808@oracle.com> Bug: https://bugs.openjdk.java.net/browse/JDK-8139837 Webrev: http://cr.openjdk.java.net/~rfield/8139837.webrev/ Thanks, Robert From grigory.ptashko at gmail.com Sun Apr 24 20:47:27 2016 From: grigory.ptashko at gmail.com (Grigory Ptashko) Date: Sun, 24 Apr 2016 23:47:27 +0300 Subject: jshell executable Message-ID: <8D4A497D-5A3A-4FA4-99C7-C0FEEA85043A@gmail.com> Hello. Can anyone, please, tell me where in the jdk source tree can I find the sources for creating the jshell executable? The binary which is located in the bin folder of the jdk. Thank you. -- Best regards, Grigory Ptashko +7 (916) 1489766 grigory.ptashko at gmail.com facebook.com/GrigoryPtashko From aaylward at gmail.com Sun Apr 24 21:55:06 2016 From: aaylward at gmail.com (Andy Aylward) Date: Sun, 24 Apr 2016 17:55:06 -0400 Subject: jshell executable In-Reply-To: <8D4A497D-5A3A-4FA4-99C7-C0FEEA85043A@gmail.com> References: <8D4A497D-5A3A-4FA4-99C7-C0FEEA85043A@gmail.com> Message-ID: Hi Grigory, I think what you're looking for is at http://hg.openjdk.java.net/kulla/dev/langtools/ . Andy On Sun, Apr 24, 2016 at 4:47 PM, Grigory Ptashko wrote: > Hello. > > Can anyone, please, tell me where in the jdk source tree > can I find the sources for creating the jshell executable? > The binary which is located in the bin folder of the jdk. > > Thank you. > > -- > Best regards, > Grigory Ptashko > > +7 (916) 1489766 > grigory.ptashko at gmail.com > facebook.com/GrigoryPtashko > > From grigory.ptashko at gmail.com Sun Apr 24 21:57:50 2016 From: grigory.ptashko at gmail.com (Grigory Ptashko) Date: Mon, 25 Apr 2016 00:57:50 +0300 Subject: jshell executable In-Reply-To: References: <8D4A497D-5A3A-4FA4-99C7-C0FEEA85043A@gmail.com> Message-ID: <25860546-393D-4E0B-98DA-6775491A4749@gmail.com> Yes, I know that. But I was hoping that someone would show me the exact place where the sources/scripts/Makefiles for the jshell binary are located inside the langtools tree. > On 25 ???. 2016 ?., at 0:55, Andy Aylward wrote: > > Hi Grigory, > > I think what you're looking for is at http://hg.openjdk.java.net/kulla/dev/langtools/ . > > Andy > > On Sun, Apr 24, 2016 at 4:47 PM, Grigory Ptashko wrote: > Hello. > > Can anyone, please, tell me where in the jdk source tree > can I find the sources for creating the jshell executable? > The binary which is located in the bin folder of the jdk. > > Thank you. > > -- > Best regards, > Grigory Ptashko > > +7 (916) 1489766 > grigory.ptashko at gmail.com > facebook.com/GrigoryPtashko > > -- Best regards, Grigory Ptashko +7 (916) 1489766 grigory.ptashko at gmail.com facebook.com/GrigoryPtashko From grigory.ptashko at gmail.com Mon Apr 25 11:44:42 2016 From: grigory.ptashko at gmail.com (Grigory Ptashko) Date: Mon, 25 Apr 2016 14:44:42 +0300 Subject: jshell executable In-Reply-To: <25860546-393D-4E0B-98DA-6775491A4749@gmail.com> References: <8D4A497D-5A3A-4FA4-99C7-C0FEEA85043A@gmail.com> <25860546-393D-4E0B-98DA-6775491A4749@gmail.com> Message-ID: <12B7F077-5B09-40D3-A410-0DA8EF5E557B@gmail.com> Hello again! Can anyone give me a hint on this? That?s really a tough one for me.. I cannot find the answer. Thank you. > On 25 ???. 2016 ?., at 0:57, Grigory Ptashko wrote: > > Yes, I know that. > > But I was hoping that someone would show me the exact place where > the sources/scripts/Makefiles for the jshell binary are located inside the > langtools tree. > >> On 25 ???. 2016 ?., at 0:55, Andy Aylward wrote: >> >> Hi Grigory, >> >> I think what you're looking for is at http://hg.openjdk.java.net/kulla/dev/langtools/ . >> >> Andy >> >> On Sun, Apr 24, 2016 at 4:47 PM, Grigory Ptashko wrote: >> Hello. >> >> Can anyone, please, tell me where in the jdk source tree >> can I find the sources for creating the jshell executable? >> The binary which is located in the bin folder of the jdk. >> >> Thank you. >> >> -- >> Best regards, >> Grigory Ptashko >> >> +7 (916) 1489766 >> grigory.ptashko at gmail.com >> facebook.com/GrigoryPtashko >> >> > > > -- > Best regards, > Grigory Ptashko > > +7 (916) 1489766 > grigory.ptashko at gmail.com > facebook.com/GrigoryPtashko > -- Best regards, Grigory Ptashko +7 (916) 1489766 grigory.ptashko at gmail.com facebook.com/GrigoryPtashko From jan.lahoda at oracle.com Mon Apr 25 12:14:52 2016 From: jan.lahoda at oracle.com (Jan Lahoda) Date: Mon, 25 Apr 2016 14:14:52 +0200 Subject: jshell executable In-Reply-To: <12B7F077-5B09-40D3-A410-0DA8EF5E557B@gmail.com> References: <8D4A497D-5A3A-4FA4-99C7-C0FEEA85043A@gmail.com> <25860546-393D-4E0B-98DA-6775491A4749@gmail.com> <12B7F077-5B09-40D3-A410-0DA8EF5E557B@gmail.com> Message-ID: <571E0A3C.3010700@oracle.com> Hi Grigory, The file that causes the creation of the jshell launcher is this one: http://hg.openjdk.java.net/jdk9/dev/jdk/file/06bd77b3af21/make/launcher/Launcher-jdk.jshell.gmk It reuses the standard launcher makefile, shared by all the launchers: http://hg.openjdk.java.net/jdk9/dev/jdk/file/06bd77b3af21/make/launcher/LauncherCommon.gmk The main generic launcher code is then, AFAIK, in the jdk/src/java.base module, e.g.: http://hg.openjdk.java.net/jdk9/dev/jdk/file/06bd77b3af21/src/java.base/share/native/launcher/main.c Jan On 25.4.2016 13:44, Grigory Ptashko wrote: > Hello again! > > Can anyone give me a hint on this? > > That?s really a tough one for me.. I cannot find the answer. > > Thank you. > >> On 25 ???. 2016 ?., at 0:57, Grigory Ptashko wrote: >> >> Yes, I know that. >> >> But I was hoping that someone would show me the exact place where >> the sources/scripts/Makefiles for the jshell binary are located inside the >> langtools tree. >> >>> On 25 ???. 2016 ?., at 0:55, Andy Aylward wrote: >>> >>> Hi Grigory, >>> >>> I think what you're looking for is at http://hg.openjdk.java.net/kulla/dev/langtools/ . >>> >>> Andy >>> >>> On Sun, Apr 24, 2016 at 4:47 PM, Grigory Ptashko wrote: >>> Hello. >>> >>> Can anyone, please, tell me where in the jdk source tree >>> can I find the sources for creating the jshell executable? >>> The binary which is located in the bin folder of the jdk. >>> >>> Thank you. >>> >>> -- >>> Best regards, >>> Grigory Ptashko >>> >>> +7 (916) 1489766 >>> grigory.ptashko at gmail.com >>> facebook.com/GrigoryPtashko >>> >>> >> >> >> -- >> Best regards, >> Grigory Ptashko >> >> +7 (916) 1489766 >> grigory.ptashko at gmail.com >> facebook.com/GrigoryPtashko >> > > > -- > Best regards, > Grigory Ptashko > > +7 (916) 1489766 > grigory.ptashko at gmail.com > facebook.com/GrigoryPtashko > From grigory.ptashko at gmail.com Mon Apr 25 12:58:24 2016 From: grigory.ptashko at gmail.com (Grigory Ptashko) Date: Mon, 25 Apr 2016 15:58:24 +0300 Subject: jshell executable In-Reply-To: <571E0A3C.3010700@oracle.com> References: <8D4A497D-5A3A-4FA4-99C7-C0FEEA85043A@gmail.com> <25860546-393D-4E0B-98DA-6775491A4749@gmail.com> <12B7F077-5B09-40D3-A410-0DA8EF5E557B@gmail.com> <571E0A3C.3010700@oracle.com> Message-ID: Great! Thank you. That?s what I was looking for. > On 25 ???. 2016 ?., at 15:14, Jan Lahoda wrote: > > Hi Grigory, > > The file that causes the creation of the jshell launcher is this one: > http://hg.openjdk.java.net/jdk9/dev/jdk/file/06bd77b3af21/make/launcher/Launcher-jdk.jshell.gmk > > It reuses the standard launcher makefile, shared by all the launchers: > http://hg.openjdk.java.net/jdk9/dev/jdk/file/06bd77b3af21/make/launcher/LauncherCommon.gmk > > The main generic launcher code is then, AFAIK, in the jdk/src/java.base module, e.g.: > http://hg.openjdk.java.net/jdk9/dev/jdk/file/06bd77b3af21/src/java.base/share/native/launcher/main.c > > Jan > > On 25.4.2016 13:44, Grigory Ptashko wrote: >> Hello again! >> >> Can anyone give me a hint on this? >> >> That?s really a tough one for me.. I cannot find the answer. >> >> Thank you. >> >>> On 25 ???. 2016 ?., at 0:57, Grigory Ptashko wrote: >>> >>> Yes, I know that. >>> >>> But I was hoping that someone would show me the exact place where >>> the sources/scripts/Makefiles for the jshell binary are located inside the >>> langtools tree. >>> >>>> On 25 ???. 2016 ?., at 0:55, Andy Aylward wrote: >>>> >>>> Hi Grigory, >>>> >>>> I think what you're looking for is at http://hg.openjdk.java.net/kulla/dev/langtools/ . >>>> >>>> Andy >>>> >>>> On Sun, Apr 24, 2016 at 4:47 PM, Grigory Ptashko wrote: >>>> Hello. >>>> >>>> Can anyone, please, tell me where in the jdk source tree >>>> can I find the sources for creating the jshell executable? >>>> The binary which is located in the bin folder of the jdk. >>>> >>>> Thank you. >>>> >>>> -- >>>> Best regards, >>>> Grigory Ptashko >>>> >>>> +7 (916) 1489766 >>>> grigory.ptashko at gmail.com >>>> facebook.com/GrigoryPtashko >>>> >>>> >>> >>> >>> -- >>> Best regards, >>> Grigory Ptashko >>> >>> +7 (916) 1489766 >>> grigory.ptashko at gmail.com >>> facebook.com/GrigoryPtashko >>> >> >> >> -- >> Best regards, >> Grigory Ptashko >> >> +7 (916) 1489766 >> grigory.ptashko at gmail.com >> facebook.com/GrigoryPtashko >> -- Best regards, Grigory Ptashko +7 (916) 1489766 grigory.ptashko at gmail.com facebook.com/GrigoryPtashko From jan.lahoda at oracle.com Mon Apr 25 14:27:30 2016 From: jan.lahoda at oracle.com (Jan Lahoda) Date: Mon, 25 Apr 2016 16:27:30 +0200 Subject: RFR 8154485: JShell: infrastructure for multi-Snippet class wrappers In-Reply-To: <571553B6.8050100@oracle.com> References: <571553B6.8050100@oracle.com> Message-ID: <571E2952.60003@oracle.com> Hi, In Eval.compileAndLoad, there's code that is commented out (I assume it is the next phase for this). Might be better to not include the commented out code, and add it uncommented in the next phase. Nit: there appear to be newly added unused imports in JShell.java, Wrap.java, OuterImportSnippetWrap.java. Otherwise, I'm OK with this, Jan On 18.4.2016 23:37, Robert Field wrote: > Bugs: > https://bugs.openjdk.java.net/browse/JDK-8154485 > https://bugs.openjdk.java.net/browse/JDK-8154377 > > Webrev: > http://cr.openjdk.java.net/~rfield/8154485.webrev/ > > Thanks, > Robert > From stuart.marks at oracle.com Mon Apr 25 23:18:18 2016 From: stuart.marks at oracle.com (Stuart Marks) Date: Mon, 25 Apr 2016 16:18:18 -0700 Subject: Fwd: RFR(m): 8140281 deprecate Optional.get() In-Reply-To: References: Message-ID: <74bf6b8a-01bf-93b8-3490-269dc31486ce@oracle.com> [please make sure I'm listed as a recipient on any replies, as I'm not on kulla-dev] One of the changes in the langtools webrev: http://cr.openjdk.java.net/~smarks/reviews/8140281/webrev.0.langtools/ is in JShell. Please review. I think this code can be cleaned up and replaced with a call to String.join(). I'd be happy to help with this as part of a separate changeset. Thanks, s'marks -------- Forwarded Message -------- Subject: RFR(m): 8140281 deprecate Optional.get() Date: Mon, 25 Apr 2016 16:05:13 -0700 From: Stuart Marks To: core-libs-dev Hi all, Please review these webrevs that deprecate Optional.get() and to replace it with Optional.getWhenPresent(). The corresponding changes are also applied to OptionalDouble.getAsDouble(), OptionalInt.getAsInt(), and OptionalLong.getAsLong(). Unlike most deprecations, this isn't about the function or the utility of some API, it's about the name. The solution is basically to rename the API. The problem is that "get" shows up as the "obvious" choice in things like IDE code completion, leading to code that mishandles empty Optionals. Typical Stack Overflow discourse runs something like this: Q: what do I do with this Optional thing A: just call get() Q: thanks, it works! Of course, it works until it doesn't. Examining the JDK's use of Optional.get(), I didn't see very many cases that called get() without first checking for the presence of a value. But I did see quite a number of cases like this: if (opt.isPresent()) { doSomething(opt.get()); } else { doSomethingElse(); } In many of these cases, the code could be refactored to use other Optional methods such as filter(), map(), or ifPresent(). In any case this reinforces the contention that use of get() leads to poor code. For this changeset, in just about all cases I've simply replaced the call to get() with a call to getWhenPresent(). In a couple cases I replaced the stream calls .filter(Optional::isPresent).map(Optional::get) with .flatMap(Optional::stream) which I hope will become the new idiom for unwrapping a stream of Optionals. While many cases could be cleaned up further, I didn't change them. The reasons are that I didn't want to spend too much time putting code cleanup into the critical path of this changeset (I'd be happy to help later); doing so would create potential conflicts with code coming in from the Jigsaw forest; and there are non-obvious places where converting from a conditional to one of the lambda-based methods could cause performance problems at startup. There are also a few cases where simplification is prevented because it would end up causing the resulting lambda expressions to throw checked exceptions. :-( Webrevs here: http://cr.openjdk.java.net/~smarks/reviews/8140281/webrev.0.langtools/ http://cr.openjdk.java.net/~smarks/reviews/8140281/webrev.0.jdk/ Thanks, s'marks From robert.field at oracle.com Tue Apr 26 04:26:44 2016 From: robert.field at oracle.com (Robert Field) Date: Mon, 25 Apr 2016 21:26:44 -0700 Subject: Fwd: RFR(m): 8140281 deprecate Optional.get() In-Reply-To: <74bf6b8a-01bf-93b8-3490-269dc31486ce@oracle.com> References: <74bf6b8a-01bf-93b8-3490-269dc31486ce@oracle.com> Message-ID: <571EEE04.4010508@oracle.com> Thumbs up to JShellTool code. See below. On 04/25/16 16:18, Stuart Marks wrote: > [please make sure I'm listed as a recipient on any replies, as I'm not > on kulla-dev] > > One of the changes in the langtools webrev: > > http://cr.openjdk.java.net/~smarks/reviews/8140281/webrev.0.langtools/ > > is in JShell. Please review. > > I think this code can be cleaned up and replaced with a call to > String.join(). I'd be happy to help with this as part of a separate > changeset. Always happy to get code improvements. -Robert > > Thanks, > > s'marks > > > -------- Forwarded Message -------- > Subject: RFR(m): 8140281 deprecate Optional.get() > Date: Mon, 25 Apr 2016 16:05:13 -0700 > From: Stuart Marks > To: core-libs-dev > > Hi all, > > Please review these webrevs that deprecate Optional.get() and to > replace it with Optional.getWhenPresent(). The corresponding changes > are also applied to OptionalDouble.getAsDouble(), > OptionalInt.getAsInt(), and OptionalLong.getAsLong(). > > Unlike most deprecations, this isn't about the function or the utility > of some API, it's about the name. The solution is basically to rename > the API. The problem is that "get" shows up as the "obvious" choice in > things like IDE code completion, leading to code that mishandles empty > Optionals. Typical Stack Overflow discourse runs something like this: > > Q: what do I do with this Optional thing > > A: just call get() > > Q: thanks, it works! > > Of course, it works until it doesn't. > > Examining the JDK's use of Optional.get(), I didn't see very many > cases that called get() without first checking for the presence of a > value. But I did see quite a number of cases like this: > > if (opt.isPresent()) { > doSomething(opt.get()); > } else { > doSomethingElse(); > } > > In many of these cases, the code could be refactored to use other > Optional methods such as filter(), map(), or ifPresent(). > > In any case this reinforces the contention that use of get() leads to > poor code. > > For this changeset, in just about all cases I've simply replaced the > call to get() with a call to getWhenPresent(). In a couple cases I > replaced the stream calls > > .filter(Optional::isPresent).map(Optional::get) > > with > > .flatMap(Optional::stream) > > which I hope will become the new idiom for unwrapping a stream of > Optionals. > > While many cases could be cleaned up further, I didn't change them. > The reasons are that I didn't want to spend too much time putting code > cleanup into the critical path of this changeset (I'd be happy to help > later); doing so would create potential conflicts with code coming in > from the Jigsaw forest; and there are non-obvious places where > converting from a conditional to one of the lambda-based methods could > cause performance problems at startup. > > There are also a few cases where simplification is prevented because > it would end up causing the resulting lambda expressions to throw > checked exceptions. :-( > > Webrevs here: > > http://cr.openjdk.java.net/~smarks/reviews/8140281/webrev.0.langtools/ > > http://cr.openjdk.java.net/~smarks/reviews/8140281/webrev.0.jdk/ > > Thanks, > > s'marks From robert.field at oracle.com Wed Apr 27 04:17:01 2016 From: robert.field at oracle.com (Robert Field) Date: Tue, 26 Apr 2016 21:17:01 -0700 Subject: RFR 8154485: JShell: infrastructure for multi-Snippet class wrappers In-Reply-To: <571E2952.60003@oracle.com> References: <571553B6.8050100@oracle.com> <571E2952.60003@oracle.com> Message-ID: <57203D3D.6080108@oracle.com> Just to track on this thread... Removed the commented out code and unused imports. Pushed yesterday. -Robert On 04/25/16 07:27, Jan Lahoda wrote: > Hi, > > In Eval.compileAndLoad, there's code that is commented out (I assume > it is the next phase for this). Might be better to not include the > commented out code, and add it uncommented in the next phase. > > Nit: there appear to be newly added unused imports in JShell.java, > Wrap.java, OuterImportSnippetWrap.java. > > Otherwise, I'm OK with this, > > Jan > > On 18.4.2016 23:37, Robert Field wrote: >> Bugs: >> https://bugs.openjdk.java.net/browse/JDK-8154485 >> https://bugs.openjdk.java.net/browse/JDK-8154377 >> >> Webrev: >> http://cr.openjdk.java.net/~rfield/8154485.webrev/ >> >> Thanks, >> Robert >> From stuart.marks at oracle.com Thu Apr 28 01:37:37 2016 From: stuart.marks at oracle.com (Stuart Marks) Date: Wed, 27 Apr 2016 18:37:37 -0700 Subject: JShell vs Optional.get() Message-ID: (new thread spawned from "Fwd: RFR(m): 8140281 deprecate Optional.get()") > Thumbs up to JShellTool code. Thanks. The original changeset seems to have been ... ah ... sidetracked, so I probably won't be pushing the change from get() to getWhenPresent() anytime soon. Meanwhile, I'll explain in a bit more detail about some issues I see in the particular bit of JShell code that uses Optional.get(). I had said: >> I think this code can be cleaned up and replaced with a call to >> String.join(). I'd be happy to help with this as part of a separate >> changeset. > > Always happy to get code improvements. Thanks for being receptive to comments. From the earlier webrev, http://cr.openjdk.java.net/~smarks/reviews/8140281/webrev.0.langtools/ if you look in src/jdk.jshell/share/classes/jdk/internal/jshell/tool/JShellTool.java, there is the following code: 1198 int length = 0; 1199 int first = replayableHistory.size(); 1200 while(length < Preferences.MAX_VALUE_LENGTH && --first >= 0) { 1201 length += replayableHistory.get(first).length() + sepLen; 1202 } 1203 String hist = replayableHistory 1204 .subList(first + 1, replayableHistory.size()) 1205 .stream() 1206 .reduce( (a, b) -> a + RECORD_SEPARATOR + b) 1207 .get(); The problem here is that get() will throw an exception if reduce() returns an empty Optional, which it can, based on my reading of the code. Changing this to the [proposed] getWhenPresent() makes this a bit more explicit, but doesn't fix the problem. The usual fix is to use one of the Optional methods that handles the empty case. Instead of get(), for example, one might call orElse("default") to supply a default string value. But looking further, I note that the reduce() lambda is a (flawed) idiom for joining strings with a separator. In Java 8 we introduced a String.join() method which does this, avoiding the need for a stream entirely. It also handles the empty case correctly. String hist = String.join(RECORD_SEPARATOR, replayableHistory.subList(first + 1, replayableHistory.size())); s'marks From robert.field at oracle.com Thu Apr 28 03:06:27 2016 From: robert.field at oracle.com (Robert Field) Date: Wed, 27 Apr 2016 20:06:27 -0700 Subject: JShell vs Optional.get() In-Reply-To: References: Message-ID: <57217E33.8030800@oracle.com> Thanks much, Stuart! I've created: https://bugs.openjdk.java.net/browse/JDK-8155581 to address this issue. -Robert On 04/27/16 18:37, Stuart Marks wrote: > (new thread spawned from "Fwd: RFR(m): 8140281 deprecate Optional.get()") > >> Thumbs up to JShellTool code. > > Thanks. The original changeset seems to have been ... ah ... > sidetracked, so I probably won't be pushing the change from get() to > getWhenPresent() anytime soon. > > Meanwhile, I'll explain in a bit more detail about some issues I see > in the particular bit of JShell code that uses Optional.get(). I had > said: > >>> I think this code can be cleaned up and replaced with a call to >>> String.join(). I'd be happy to help with this as part of a separate >>> changeset. >> >> Always happy to get code improvements. > > Thanks for being receptive to comments. > > From the earlier webrev, > > http://cr.openjdk.java.net/~smarks/reviews/8140281/webrev.0.langtools/ > > if you look in > src/jdk.jshell/share/classes/jdk/internal/jshell/tool/JShellTool.java, > there is the following code: > > 1198 int length = 0; > 1199 int first = replayableHistory.size(); > 1200 while(length < Preferences.MAX_VALUE_LENGTH && > --first >= 0) { > 1201 length += replayableHistory.get(first).length() + > sepLen; > 1202 } > 1203 String hist = replayableHistory > 1204 .subList(first + 1, replayableHistory.size()) > 1205 .stream() > 1206 .reduce( (a, b) -> a + RECORD_SEPARATOR + b) > 1207 .get(); > > The problem here is that get() will throw an exception if reduce() > returns an empty Optional, which it can, based on my reading of the > code. Changing this to the [proposed] getWhenPresent() makes this a > bit more explicit, but doesn't fix the problem. > > The usual fix is to use one of the Optional methods that handles the > empty case. Instead of get(), for example, one might call > orElse("default") to supply a default string value. > > But looking further, I note that the reduce() lambda is a (flawed) > idiom for joining strings with a separator. In Java 8 we introduced a > String.join() method which does this, avoiding the need for a stream > entirely. It also handles the empty case correctly. > > String hist = String.join(RECORD_SEPARATOR, > replayableHistory.subList(first + 1, replayableHistory.size())); > > s'marks > From robert.field at oracle.com Thu Apr 28 17:39:36 2016 From: robert.field at oracle.com (Robert Field) Date: Thu, 28 Apr 2016 10:39:36 -0700 Subject: RFR 8139832: JShell API: Diag constructor should not be exposed and fix typo Message-ID: <57224AD8.1060801@oracle.com> Bug: https://bugs.openjdk.java.net/browse/JDK-8139832 Webrev: http://cr.openjdk.java.net/~rfield/8139832.webrev/ -Robert From jan.lahoda at oracle.com Fri Apr 29 16:31:31 2016 From: jan.lahoda at oracle.com (Jan Lahoda) Date: Fri, 29 Apr 2016 18:31:31 +0200 Subject: RFR 8139837: JShell API: make a common JShellException In-Reply-To: <5719AAA5.2050808@oracle.com> References: <5719AAA5.2050808@oracle.com> Message-ID: <57238C63.8060408@oracle.com> Seems fine to me. Jan On 22.4.2016 06:37, Robert Field wrote: > Bug: > https://bugs.openjdk.java.net/browse/JDK-8139837 > > Webrev: > http://cr.openjdk.java.net/~rfield/8139837.webrev/ > > Thanks, > Robert > From stuart.marks at oracle.com Fri Apr 29 21:49:40 2016 From: stuart.marks at oracle.com (Stuart Marks) Date: Fri, 29 Apr 2016 14:49:40 -0700 Subject: RFR 8147984: WindowsTerminal should support function keys In-Reply-To: <56A21578.5080105@oracle.com> References: <56A21578.5080105@oracle.com> Message-ID: Hi Jan, I finally got a chance to take a look at this. The change looks fine. It would be nice to have a reference to where the escape sequences are documented. There are links to the Windows VK_ codes there, which is great. But there's no reference for the escape sequences that each keypress is mapped to, e.g. F4 is "ESC O S", and F5 is "ESC [ 1 5 ~" (and what happened to "ESC [ 1 6 ~"??) I did some searching, and it seems really hard to find a definitive reference. Perhaps the best reference is "XTerm Control Sequences" [1] which seems to document xterm pretty thoroughly, which is what everybody seems to follow nowadays. It even looks like it's being kept up to date (last modified 2016-02-21). Anyway I'd suggest adding a comment with a reference to this document. As a cross-check, these sequences match what my Mac's Terminal.app emits, at least for unshifted F1-F12. (The Terminal app was probably copied from xterm.) Thanks, s'marks [1] http://invisible-island.net/xterm/ctlseqs/ctlseqs.html On 1/22/16 3:41 AM, Jan Lahoda wrote: > Hello, > > I'd like to enhance the WindowsTerminal in jdk.internal.le with function keys > handling. The intent is so that jshell can bind actions for shortcuts including > function keys. > > The patch for adding the function keys support is here: > http://cr.openjdk.java.net/~jlahoda/8147984/webrev.00/ > > An example of a feature that uses/may use this support is here: > http://mail.openjdk.java.net/pipermail/kulla-dev/2016-January/001226.html > > Any comments are welcome! > > Thanks, > Jan