-
Bug
-
Resolution: Fixed
-
P3
-
14, 15, 16
-
b09
-
generic
-
generic
Support for record was added in JShell for JDK-14.
Reproduced as follows...
In JDK-13 jshell tool do:
jshell> /set mode bug normal -command
| Created new feedback mode: bug
jshell> /set mode -retain bug
In JDK-14 jshell tool (passed --enable-preview) do:
jshell> /set feedback bug
| Feedback mode: bug
jshell> interface Expr {}
| created interface Expr
jshell> public record ConstExpr(Expr e) implements Expr{}
| created method ConstExpr()
Note: records are called methods in this and other cases.
There are at least two issues here:
(1) rather than catching the error, it seems to fail down to the next format.
(2) there is no support for upgrading old mode definitions
Work-around for now: Either rebuild the custom mode from a built-in mode or edit the custom mode to handle all places that "record" is present in new built-in modes (5 places).
Reproduced as follows...
In JDK-13 jshell tool do:
jshell> /set mode bug normal -command
| Created new feedback mode: bug
jshell> /set mode -retain bug
In JDK-14 jshell tool (passed --enable-preview) do:
jshell> /set feedback bug
| Feedback mode: bug
jshell> interface Expr {}
| created interface Expr
jshell> public record ConstExpr(Expr e) implements Expr{}
| created method ConstExpr()
Note: records are called methods in this and other cases.
There are at least two issues here:
(1) rather than catching the error, it seems to fail down to the next format.
(2) there is no support for upgrading old mode definitions
Work-around for now: Either rebuild the custom mode from a built-in mode or edit the custom mode to handle all places that "record" is present in new built-in modes (5 places).