Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8249566

jshell tool: retained modes from JDK-13 or prior cause confusing messages to be generated for records

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: P3 P3
    • 16
    • 14, 15, 16
    • tools
    • 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).

            rfield Robert Field (Inactive)
            rfield Robert Field (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: