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

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: P3
    • Resolution: Fixed
    • Affects Version/s: 14, 15, 16
    • Fix Version/s: 16
    • Component/s: tools
    • Labels:
    • Subcomponent:
    • Resolved In Build:
      b09
    • CPU:
      generic
    • OS:
      generic

      Description

      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).

        Attachments

          Activity

            People

            • Assignee:
              rfield Robert Field
              Reporter:
              rfield Robert Field
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: