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

JShell tool: crash in jshell when variable cannot be referenced

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: P3
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 9-repo-kulla
    • Component/s: tools
    • Labels:

      Description

      Steps to reproduce:
      -> int a = q
      | Replaced variable a, however, it cannot be referenced until variable q is declared

      -> /v

      Exception in thread "main" java.lang.IllegalArgumentException: Key parameter if varValue() 'VariableKey(a)#18' must be Active, it is: ActiveFailed
      at jdk.internal.jshell.impl.JShellStateImpl.varValue(JShellStateImpl.java:96)
      at jdk.internal.jshell.tool.JShellTool.cmdVars(JShellTool.java:1116)
      at jdk.internal.jshell.tool.JShellTool.lambda$new$15(JShellTool.java:585)
      at jdk.internal.jshell.tool.JShellTool.processCommand(JShellTool.java:433)
      at jdk.internal.jshell.tool.JShellTool.run(JShellTool.java:395)
      at jdk.internal.jshell.tool.JShellTool.start(JShellTool.java:221)
      at jdk.internal.jshell.tool.JShellTool.start(JShellTool.java:200)
      at jdk.internal.jshell.tool.JShellTool.main(JShellTool.java:190)

        Attachments

          Issue Links

            Activity

              People

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

                Dates

                Created:
                Updated:
                Resolved: