From michel.trudeau at oracle.com Tue Jan 7 01:59:24 2020 From: michel.trudeau at oracle.com (Michel Trudeau) Date: Mon, 6 Jan 2020 17:59:24 -0800 Subject: jshell has trouble to register some records in the environment In-Reply-To: <1251047890.64526.1577382348691.JavaMail.zimbra@u-pem.fr> References: <1810593817.43607.1577363076142.JavaMail.zimbra@u-pem.fr> <1251047890.64526.1577382348691.JavaMail.zimbra@u-pem.fr> Message-ID: <20201A75-38A9-4F23-8B55-A7CF1B4C029E@oracle.com> moving the conversation to kulla-dev On Dec 26, 2019, at 9:45 AM, forax at univ-mlv.fr wrote: > De: "Ali Ebrahimi" > ?: "Remi Forax" > Cc: "amber-dev" > Envoy?: Jeudi 26 D?cembre 2019 17:48:35 > Objet: Re: jshell has trouble to register some records in the environment > hi Remi, > Is there typo in > ...> return Math.hypot( with , height); // width Thanks Ali ! Anyway, jshell should report this as an error. Is there an empty catch block somewhere ?? R?mi > On Thu, Dec 26, 2019 at 3:54 PM Remi Forax < [ mailto:forax at univ-mlv.fr | > forax at univ-mlv.fr ] > wrote: >> Hi all, >> converting some materials for undergraduates, i have uncover a weird bug. >> This snippet of code doesn't work in jshell >> (jshell --enable-preview). >> I get >> jshell> record Rectangle(int width, int height) { >> ...> double diagonal() { >> ...> return Math.hypot(with, height); >> ...> } >> ...> } >> ...> var rectangle2 = new Rectangle(4, 3); >> ...> System.out.println(rectangle2.diagonal()); >> | Error: >> | cannot find symbol >> | symbol: class Rectangle >> | var rectangle2 = new Rectangle(4, 3); >> | ^-------^ >> So the class/record Rectangle doesn't seem to be registered ? >> Changing it to >> record Rectangle(int width, int height) { >> double diagonal() { >> return 5; >> } >> } >> var rectangle2 = new Rectangle(4, 3); >> System.out.println(rectangle2.diagonal()); >> do work ?? >> R?mi > -- > Best Regards, > Ali Ebrahimi From michel.trudeau at oracle.com Tue Jan 7 23:38:29 2020 From: michel.trudeau at oracle.com (Michel Trudeau) Date: Tue, 7 Jan 2020 15:38:29 -0800 Subject: Quitting jshell extremely slow on my Mac In-Reply-To: <55168D2C-732B-4FEB-92E3-029C64E70510@oracle.com> References: <55168D2C-732B-4FEB-92E3-029C64E70510@oracle.com> Message-ID: I can?t reproduce this. Anyone else can ? On Dec 22, 2019, at 5:26 PM, Weijun Wang wrote: Quitting jshell with /exit or Ctrl-D is extremely slow here. It just wait for about half a minute and then quit. If I create a brand new user and run jshell there, it quits immediately. I don't think I've created any startup scripts for jshell for my own user. "find . | grep jshell" in $HOME shows nothing interesting. Here is a gist of jstack outputs. There are 2 processes. I took once before Ctrl-D (line 426), and multiple times after it. https://gist.github.com/wangweij/ead6d024e713f3863df061930e6f2e29 I'm using fastdebug build 14-ea+24-1107 and I'm on macOS 10.14.6. What could be the problem? Thanks in advance, Max From weijun.wang at oracle.com Wed Jan 8 02:22:43 2020 From: weijun.wang at oracle.com (Weijun Wang) Date: Wed, 8 Jan 2020 10:22:43 +0800 Subject: Quitting jshell extremely slow on my Mac In-Reply-To: References: <55168D2C-732B-4FEB-92E3-029C64E70510@oracle.com> Message-ID: Oops, I just fixed this. First I was thinking about whether there is something in my $HOME that made jshell slow, so I "export HOME=/tmp/x" and run jshell, it terminates immediately. Then I set it back, the same. Then I opened another terminal windows, still fast. I even restart the system, still fast. I almost feel the command launches a little faster. Nothing was left in /tmp/xxx, and I don't know what happened in my real $HOME. --Max > On Jan 8, 2020, at 7:38 AM, Michel Trudeau wrote: > > I can?t reproduce this. Anyone else can ? > > On Dec 22, 2019, at 5:26 PM, Weijun Wang wrote: > > Quitting jshell with /exit or Ctrl-D is extremely slow here. It just wait for about half a minute and then quit. > > If I create a brand new user and run jshell there, it quits immediately. I don't think I've created any startup scripts for jshell for my own user. "find . | grep jshell" in $HOME shows nothing interesting. > > Here is a gist of jstack outputs. There are 2 processes. I took once before Ctrl-D (line 426), and multiple times after it. > > https://gist.github.com/wangweij/ead6d024e713f3863df061930e6f2e29 > > I'm using fastdebug build 14-ea+24-1107 and I'm on macOS 10.14.6. > > What could be the problem? > > Thanks in advance, > Max > > From jan.lahoda at oracle.com Wed Jan 8 16:25:20 2020 From: jan.lahoda at oracle.com (Jan Lahoda) Date: Wed, 8 Jan 2020 17:25:20 +0100 Subject: RFR (14): JDK-8236715: Records with errors are not properly corraled Message-ID: Consider a record that e.g.: record R(int i) { public int g() { return unknown; } } putting this into jshell (which was started with --enable-preview) will lead to no response and "R" won't be declared: --- jshell> record R(int i) { public int g() { return unknown; } } jshell> new R(1) | Error: | cannot find symbol | symbol: class R | new R(1) | ^ --- This is because the records are not properly corralled, and when corralled, the note to the user is not printed properly. The proposed patch strives to fix that. Proposed change: http://cr.openjdk.java.net/~jlahoda/8236715/webrev.00/ JBS: https://bugs.openjdk.java.net/browse/JDK-8236715 How does this look? Thanks, Jan From vicente.romero at oracle.com Wed Jan 8 17:13:28 2020 From: vicente.romero at oracle.com (Vicente Romero) Date: Wed, 8 Jan 2020 12:13:28 -0500 Subject: RFR (14): JDK-8236715: Records with errors are not properly corraled In-Reply-To: References: Message-ID: looks good, Vicente On 1/8/20 11:25 AM, Jan Lahoda wrote: > Consider a record that e.g.: > > record R(int i) { public int g() { return unknown; } } > > putting this into jshell (which was started with --enable-preview) > will lead to no response and "R" won't be declared: > --- > jshell>? record R(int i) { public int g() { return unknown; } } > > jshell> new R(1) > |? Error: > |? cannot find symbol > |??? symbol:?? class R > |? new R(1) > |????? ^ > --- > > This is because the records are not properly corralled, and when > corralled, the note to the user is not printed properly. The proposed > patch strives to fix that. > > Proposed change: > http://cr.openjdk.java.net/~jlahoda/8236715/webrev.00/ > > JBS: https://bugs.openjdk.java.net/browse/JDK-8236715 > > How does this look? > > Thanks, > ???? Jan From jan.lahoda at oracle.com Wed Jan 8 19:34:35 2020 From: jan.lahoda at oracle.com (Jan Lahoda) Date: Wed, 8 Jan 2020 20:34:35 +0100 Subject: RFR (14): JDK-8236715: Records with errors are not properly corraled In-Reply-To: References: Message-ID: FWIW, the behavior with the patch is: --- jshell> record R(int i) { public int g() { return unknown; } } | created record R, however, it cannot be instantiated or its methods invoked until variable unknown is declared jshell> new R(1) | attempted to use record R which cannot be instantiated or its methods invoked until variable unknown is declared --- Jan On 08. 01. 20 18:13, Vicente Romero wrote: > looks good, > Vicente > > On 1/8/20 11:25 AM, Jan Lahoda wrote: >> Consider a record that e.g.: >> >> record R(int i) { public int g() { return unknown; } } >> >> putting this into jshell (which was started with --enable-preview) >> will lead to no response and "R" won't be declared: >> --- >> jshell>? record R(int i) { public int g() { return unknown; } } >> >> jshell> new R(1) >> |? Error: >> |? cannot find symbol >> |??? symbol:?? class R >> |? new R(1) >> |????? ^ >> --- >> >> This is because the records are not properly corralled, and when >> corralled, the note to the user is not printed properly. The proposed >> patch strives to fix that. >> >> Proposed change: >> http://cr.openjdk.java.net/~jlahoda/8236715/webrev.00/ >> >> JBS: https://bugs.openjdk.java.net/browse/JDK-8236715 >> >> How does this look? >> >> Thanks, >> ???? Jan > From robert.field at oracle.com Thu Jan 9 02:09:39 2020 From: robert.field at oracle.com (Robert Field) Date: Wed, 08 Jan 2020 18:09:39 -0800 Subject: Quitting jshell extremely slow on my Mac In-Reply-To: References: <55168D2C-732B-4FEB-92E3-029C64E70510@oracle.com> Message-ID: <16f88107ab8.27ed.4011f3a8741ca2aabce58b8b81f42d24@oracle.com> Max, Seems likely your properties file is very large or computerised. Robert On January 7, 2020 6:23:15 PM Weijun Wang wrote: > Oops, I just fixed this. > > First I was thinking about whether there is something in my $HOME that made > jshell slow, so I "export HOME=/tmp/x" and run jshell, it terminates > immediately. Then I set it back, the same. Then I opened another terminal > windows, still fast. I even restart the system, still fast. I almost feel > the command launches a little faster. > > Nothing was left in /tmp/xxx, and I don't know what happened in my real $HOME. > > --Max > > >> On Jan 8, 2020, at 7:38 AM, Michel Trudeau wrote: >> >> I can?t reproduce this. Anyone else can ? >> >> On Dec 22, 2019, at 5:26 PM, Weijun Wang wrote: >> >> Quitting jshell with /exit or Ctrl-D is extremely slow here. It just wait >> for about half a minute and then quit. >> >> If I create a brand new user and run jshell there, it quits immediately. I >> don't think I've created any startup scripts for jshell for my own user. >> "find . | grep jshell" in $HOME shows nothing interesting. >> >> Here is a gist of jstack outputs. There are 2 processes. I took once before >> Ctrl-D (line 426), and multiple times after it. >> >> https://gist.github.com/wangweij/ead6d024e713f3863df061930e6f2e29 >> >> I'm using fastdebug build 14-ea+24-1107 and I'm on macOS 10.14.6. >> >> What could be the problem? >> >> Thanks in advance, >> Max >> >> From weijun.wang at oracle.com Thu Jan 9 02:12:24 2020 From: weijun.wang at oracle.com (Weijun Wang) Date: Thu, 9 Jan 2020 10:12:24 +0800 Subject: Quitting jshell extremely slow on my Mac In-Reply-To: <16f88107ab8.27ed.4011f3a8741ca2aabce58b8b81f42d24@oracle.com> References: <55168D2C-732B-4FEB-92E3-029C64E70510@oracle.com> <16f88107ab8.27ed.4011f3a8741ca2aabce58b8b81f42d24@oracle.com> Message-ID: <22951F29-9E55-42C2-8413-27E0A9FBC5A6@oracle.com> Where is the properties file? Thanks, Max > On Jan 9, 2020, at 10:09 AM, Robert Field wrote: > > Max, > Seems likely your properties file is very large or computerised. > Robert > > > On January 7, 2020 6:23:15 PM Weijun Wang wrote: > >> Oops, I just fixed this. >> >> First I was thinking about whether there is something in my $HOME that made jshell slow, so I "export HOME=/tmp/x" and run jshell, it terminates immediately. Then I set it back, the same. Then I opened another terminal windows, still fast. I even restart the system, still fast. I almost feel the command launches a little faster. >> >> Nothing was left in /tmp/xxx, and I don't know what happened in my real $HOME. >> >> --Max >> >> >>> On Jan 8, 2020, at 7:38 AM, Michel Trudeau wrote: >>> >>> I can?t reproduce this. Anyone else can ? >>> >>> On Dec 22, 2019, at 5:26 PM, Weijun Wang wrote: >>> >>> Quitting jshell with /exit or Ctrl-D is extremely slow here. It just wait for about half a minute and then quit. >>> >>> If I create a brand new user and run jshell there, it quits immediately. I don't think I've created any startup scripts for jshell for my own user. "find . | grep jshell" in $HOME shows nothing interesting. >>> >>> Here is a gist of jstack outputs. There are 2 processes. I took once before Ctrl-D (line 426), and multiple times after it. >>> >>> https://gist.github.com/wangweij/ead6d024e713f3863df061930e6f2e29 >>> >>> I'm using fastdebug build 14-ea+24-1107 and I'm on macOS 10.14.6. >>> >>> What could be the problem? >>> >>> Thanks in advance, >>> Max >>> >>> > > > From robert.field at oracle.com Thu Jan 9 06:16:44 2020 From: robert.field at oracle.com (Robert Field) Date: Wed, 8 Jan 2020 22:16:44 -0800 Subject: Quitting jshell extremely slow on my Mac In-Reply-To: <22951F29-9E55-42C2-8413-27E0A9FBC5A6@oracle.com> References: <55168D2C-732B-4FEB-92E3-029C64E70510@oracle.com> <16f88107ab8.27ed.4011f3a8741ca2aabce58b8b81f42d24@oracle.com> <22951F29-9E55-42C2-8413-27E0A9FBC5A6@oracle.com> Message-ID: Sorry, I meant to write -- ???? Seems likely your *preferences* file is very large or *compromised*. Where it is stored is OS dependent.? This may be of help: https://victor.kropp.name/blog/java-preferences-api/ -Robert On 2020-01-08 18:12, Weijun Wang wrote: > Where is the properties file? > > Thanks, > Max > >> On Jan 9, 2020, at 10:09 AM, Robert Field wrote: >> >> Max, >> Seems likely your properties file is very large or computerised. >> Robert >> >> >> On January 7, 2020 6:23:15 PM Weijun Wang wrote: >> >>> Oops, I just fixed this. >>> >>> First I was thinking about whether there is something in my $HOME that made jshell slow, so I "export HOME=/tmp/x" and run jshell, it terminates immediately. Then I set it back, the same. Then I opened another terminal windows, still fast. I even restart the system, still fast. I almost feel the command launches a little faster. >>> >>> Nothing was left in /tmp/xxx, and I don't know what happened in my real $HOME. >>> >>> --Max >>> >>> >>>> On Jan 8, 2020, at 7:38 AM, Michel Trudeau wrote: >>>> >>>> I can?t reproduce this. Anyone else can ? >>>> >>>> On Dec 22, 2019, at 5:26 PM, Weijun Wang wrote: >>>> >>>> Quitting jshell with /exit or Ctrl-D is extremely slow here. It just wait for about half a minute and then quit. >>>> >>>> If I create a brand new user and run jshell there, it quits immediately. I don't think I've created any startup scripts for jshell for my own user. "find . | grep jshell" in $HOME shows nothing interesting. >>>> >>>> Here is a gist of jstack outputs. There are 2 processes. I took once before Ctrl-D (line 426), and multiple times after it. >>>> >>>> https://gist.github.com/wangweij/ead6d024e713f3863df061930e6f2e29 >>>> >>>> I'm using fastdebug build 14-ea+24-1107 and I'm on macOS 10.14.6. >>>> >>>> What could be the problem? >>>> >>>> Thanks in advance, >>>> Max >>>> >>>> >> >> From weijun.wang at oracle.com Thu Jan 9 07:07:57 2020 From: weijun.wang at oracle.com (Weijun Wang) Date: Thu, 9 Jan 2020 15:07:57 +0800 Subject: Quitting jshell extremely slow on my Mac In-Reply-To: References: <55168D2C-732B-4FEB-92E3-029C64E70510@oracle.com> <16f88107ab8.27ed.4011f3a8741ca2aabce58b8b81f42d24@oracle.com> <22951F29-9E55-42C2-8413-27E0A9FBC5A6@oracle.com> Message-ID: <25D150DC-F8A7-43C4-AC83-2BDF8426A01D@oracle.com> I looked into the preferences file with defaults read ~/Library/Preferences/com.apple.java.util.prefs.plist / There are 522 HISTORY_LINE_nnn lines. All look normal. I can still see them with the up-arrow key in jshell now. It's a pity I don't have a backup for this file so not sure what changed. --Max > On Jan 9, 2020, at 2:16 PM, Robert Field wrote: > > Sorry, I meant to write -- > > Seems likely your preferences file is very large or compromised. > > Where it is stored is OS dependent. This may be of help: > > https://victor.kropp.name/blog/java-preferences-api/ > > -Robert > > On 2020-01-08 18:12, Weijun Wang wrote: >> Where is the properties file? >> >> Thanks, >> Max >> >> >>> On Jan 9, 2020, at 10:09 AM, Robert Field >>> wrote: >>> >>> Max, >>> Seems likely your properties file is very large or computerised. >>> Robert >>> >>> >>> On January 7, 2020 6:23:15 PM Weijun Wang >>> >>> wrote: >>> >>> >>>> Oops, I just fixed this. >>>> >>>> First I was thinking about whether there is something in my $HOME that made jshell slow, so I "export HOME=/tmp/x" and run jshell, it terminates immediately. Then I set it back, the same. Then I opened another terminal windows, still fast. I even restart the system, still fast. I almost feel the command launches a little faster. >>>> >>>> Nothing was left in /tmp/xxx, and I don't know what happened in my real $HOME. >>>> >>>> --Max >>>> >>>> >>>> >>>>> On Jan 8, 2020, at 7:38 AM, Michel Trudeau >>>>> wrote: >>>>> >>>>> I can?t reproduce this. Anyone else can ? >>>>> >>>>> On Dec 22, 2019, at 5:26 PM, Weijun Wang >>>>> >>>>> wrote: >>>>> >>>>> Quitting jshell with /exit or Ctrl-D is extremely slow here. It just wait for about half a minute and then quit. >>>>> >>>>> If I create a brand new user and run jshell there, it quits immediately. I don't think I've created any startup scripts for jshell for my own user. "find . | grep jshell" in $HOME shows nothing interesting. >>>>> >>>>> Here is a gist of jstack outputs. There are 2 processes. I took once before Ctrl-D (line 426), and multiple times after it. >>>>> >>>>> >>>>> https://gist.github.com/wangweij/ead6d024e713f3863df061930e6f2e29 >>>>> >>>>> >>>>> I'm using fastdebug build 14-ea+24-1107 and I'm on macOS 10.14.6. >>>>> >>>>> What could be the problem? >>>>> >>>>> Thanks in advance, >>>>> Max >>>>> >>>>> >>>>> >>> >>> >>> From jan.lahoda at oracle.com Thu Jan 9 12:30:32 2020 From: jan.lahoda at oracle.com (Jan Lahoda) Date: Thu, 9 Jan 2020 13:30:32 +0100 Subject: jshell has trouble to register some records in the environment In-Reply-To: <20201A75-38A9-4F23-8B55-A7CF1B4C029E@oracle.com> References: <1810593817.43607.1577363076142.JavaMail.zimbra@u-pem.fr> <1251047890.64526.1577382348691.JavaMail.zimbra@u-pem.fr> <20201A75-38A9-4F23-8B55-A7CF1B4C029E@oracle.com> Message-ID: <90c2ca34-810f-2a50-762f-e7dd7f0f6454@oracle.com> Hi, I've filled: https://bugs.openjdk.java.net/browse/JDK-8236715 and sent: https://mail.openjdk.java.net/pipermail/kulla-dev/2020-January/002467.html Thanks for the report, Jan On 07. 01. 20 2:59, Michel Trudeau wrote: > moving the conversation to kulla-dev > > On Dec 26, 2019, at 9:45 AM, forax at univ-mlv.fr wrote: > >> De: "Ali Ebrahimi" >> ?: "Remi Forax" >> Cc: "amber-dev" >> Envoy?: Jeudi 26 D?cembre 2019 17:48:35 >> Objet: Re: jshell has trouble to register some records in the environment > >> hi Remi, >> Is there typo in >> ...> return Math.hypot( with , height); // width > > Thanks Ali ! > Anyway, jshell should report this as an error. Is there an empty catch block somewhere ?? > > R?mi > >> On Thu, Dec 26, 2019 at 3:54 PM Remi Forax < [ mailto:forax at univ-mlv.fr | >> forax at univ-mlv.fr ] > wrote: > >>> Hi all, >>> converting some materials for undergraduates, i have uncover a weird bug. > >>> This snippet of code doesn't work in jshell >>> (jshell --enable-preview). > >>> I get > >>> jshell> record Rectangle(int width, int height) { >>> ...> double diagonal() { >>> ...> return Math.hypot(with, height); >>> ...> } >>> ...> } >>> ...> var rectangle2 = new Rectangle(4, 3); >>> ...> System.out.println(rectangle2.diagonal()); >>> | Error: >>> | cannot find symbol >>> | symbol: class Rectangle >>> | var rectangle2 = new Rectangle(4, 3); >>> | ^-------^ > >>> So the class/record Rectangle doesn't seem to be registered ? >>> Changing it to > >>> record Rectangle(int width, int height) { >>> double diagonal() { >>> return 5; >>> } >>> } >>> var rectangle2 = new Rectangle(4, 3); >>> System.out.println(rectangle2.diagonal()); > >>> do work ?? > >>> R?mi > >> -- > >> Best Regards, >> Ali Ebrahimi > From robert.field at oracle.com Mon Jan 13 02:10:35 2020 From: robert.field at oracle.com (Robert Field) Date: Sun, 12 Jan 2020 18:10:35 -0800 Subject: RFR (14): JDK-8236715: Records with errors are not properly corraled In-Reply-To: References: Message-ID: <5dd62eb9-d000-7637-cde6-98fa5670afac@oracle.com> Fix looks good! -Robert On 2020-01-08 08:25, Jan Lahoda wrote: > Consider a record that e.g.: > > record R(int i) { public int g() { return unknown; } } > > putting this into jshell (which was started with --enable-preview) > will lead to no response and "R" won't be declared: > --- > jshell>? record R(int i) { public int g() { return unknown; } } > > jshell> new R(1) > |? Error: > |? cannot find symbol > |??? symbol:?? class R > |? new R(1) > |????? ^ > --- > > This is because the records are not properly corralled, and when > corralled, the note to the user is not printed properly. The proposed > patch strives to fix that. > > Proposed change: > http://cr.openjdk.java.net/~jlahoda/8236715/webrev.00/ > > JBS: https://bugs.openjdk.java.net/browse/JDK-8236715 > > How does this look? > > Thanks, > ???? Jan From forax at univ-mlv.fr Fri Jan 17 18:06:36 2020 From: forax at univ-mlv.fr (Remi Forax) Date: Fri, 17 Jan 2020 19:06:36 +0100 (CET) Subject: jshell || instanceof Message-ID: <1090488738.1149489.1579284396106.JavaMail.zimbra@u-pem.fr> There is a bad interaction in between jshell and the way instanceof is specified to work with a || void plus(Number v1, Number v2) { if (v1 instanceof Integer i1 || v2 instanceof Integer i2) { System.out.println(i1); System.out.println(i2); } } plus(1, 2); | created method plus(Number,Number), however, it cannot be invoked until variable i1, and variable i2 are declared | attempted to call method plus(Number,Number) which cannot be invoked until variable i1, and variable i2 are declared Neither i1 nor i2 is inserted in the scope, so jshell reports logically that the method will work when i1 and i2 will be defined, so it works as intended but it's confusing. The root of the issue is that piggybacking on inserting variables or not in the scope let to poor and confusing error message. R?mi From jonathan.gibbons at oracle.com Mon Jan 27 23:35:41 2020 From: jonathan.gibbons at oracle.com (Jonathan Gibbons) Date: Mon, 27 Jan 2020 15:35:41 -0800 Subject: JDK-8237916 Bad copyright line in a jshell source file Message-ID: <44d44174-9986-967c-e9ad-abb97f8816fd@oracle.com> Please review a small change to an incorrectly formatted copyright header $ hg diff -R open diff -r 6cf58aab75d5 src/jdk.jshell/share/classes/jdk/jshell/OuterWrap.java --- a/src/jdk.jshell/share/classes/jdk/jshell/OuterWrap.java??? Mon Jan 27 08:36:55 2020 -0500 +++ b/src/jdk.jshell/share/classes/jdk/jshell/OuterWrap.java??? Mon Jan 27 15:31:43 2020 -0800 @@ -1,5 +1,5 @@ ?/* - * Copyright (c) 2015-2016, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015, 2016, Oracle and/or its affiliates. All rights reserved. ? * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. ? * ? * This code is free software; you can redistribute it and/or modify it -- Jon JBS: https://bugs.openjdk.java.net/browse/JDK-8237916 From vicente.romero at oracle.com Mon Jan 27 23:53:25 2020 From: vicente.romero at oracle.com (Vicente Romero) Date: Mon, 27 Jan 2020 15:53:25 -0800 (PST) Subject: JDK-8237916 Bad copyright line in a jshell source file In-Reply-To: <44d44174-9986-967c-e9ad-abb97f8816fd@oracle.com> References: <44d44174-9986-967c-e9ad-abb97f8816fd@oracle.com> Message-ID: looks good, Vicente On 1/27/20 6:35 PM, Jonathan Gibbons wrote: > Please review a small change to an incorrectly formatted copyright header > > $ hg diff -R open > diff -r 6cf58aab75d5 > src/jdk.jshell/share/classes/jdk/jshell/OuterWrap.java > --- a/src/jdk.jshell/share/classes/jdk/jshell/OuterWrap.java Mon Jan > 27 08:36:55 2020 -0500 > +++ b/src/jdk.jshell/share/classes/jdk/jshell/OuterWrap.java Mon Jan > 27 15:31:43 2020 -0800 > @@ -1,5 +1,5 @@ > ?/* > - * Copyright (c) 2015-2016, Oracle and/or its affiliates. All rights > reserved. > + * Copyright (c) 2015, 2016, Oracle and/or its affiliates. All rights > reserved. > ? * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. > ? * > ? * This code is free software; you can redistribute it and/or modify it > > -- Jon > > > JBS: https://bugs.openjdk.java.net/browse/JDK-8237916 > From forax at univ-mlv.fr Wed Jan 29 13:48:26 2020 From: forax at univ-mlv.fr (Remi Forax) Date: Wed, 29 Jan 2020 14:48:26 +0100 (CET) Subject: Switch with the arrow syntax + throw not supported Message-ID: <1969760921.1502613.1580305706219.JavaMail.zimbra@u-pem.fr> Hi all, this snippet of code doesn't work with jshell. jshell> var foo = "foo"; ...> switch(foo) { ...> default -> throw new AssertionError(); ...> } foo ==> "foo" | Error: | unreachable statement | } | ^ Obviously, it works with javac. regards, R?mi From michel.trudeau at oracle.com Wed Jan 29 14:48:21 2020 From: michel.trudeau at oracle.com (Michel Trudeau) Date: Wed, 29 Jan 2020 06:48:21 -0800 Subject: Switch with the arrow syntax + throw not supported In-Reply-To: <1969760921.1502613.1580305706219.JavaMail.zimbra@u-pem.fr> References: <1969760921.1502613.1580305706219.JavaMail.zimbra@u-pem.fr> Message-ID: It even fails with the old syntax: And that?s a regression introduced in JDK 12, as it was working in 11. We?ll file a bug. -Michel On Jan 29, 2020, at 5:48 AM, Remi Forax wrote: Hi all, this snippet of code doesn't work with jshell. jshell> var foo = "foo"; ...> switch(foo) { ...> default -> throw new AssertionError(); ...> } foo ==> "foo" | Error: | unreachable statement | } | ^ Obviously, it works with javac. regards, R?mi From robert.field at oracle.com Thu Jan 30 00:22:43 2020 From: robert.field at oracle.com (Robert Field) Date: Thu, 30 Jan 2020 00:22:43 +0000 (UTC) Subject: Switch with the arrow syntax + throw not supported In-Reply-To: References: <1969760921.1502613.1580305706219.JavaMail.zimbra@u-pem.fr> Message-ID: <527b424b-c356-fc4f-c498-d0919680503f@oracle.com> The bug is: ??? https://bugs.openjdk.java.net/browse/JDK-8238173 There are some triage notes. I'll look at this for JDK 15. -Robert On 2020-01-29 06:48, Michel Trudeau wrote: > It even fails with the old syntax: > > > > And that?s a regression introduced in JDK 12, as it was working in 11. We?ll file a bug. > > -Michel > > On Jan 29, 2020, at 5:48 AM, Remi Forax wrote: > > Hi all, > this snippet of code doesn't work with jshell. > > jshell> var foo = "foo"; > ...> switch(foo) { > ...> default -> throw new AssertionError(); > ...> } > foo ==> "foo" > | Error: > | unreachable statement > | } > | ^ > > Obviously, it works with javac. > > regards, > R?mi >