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

JShell: toString() that throws exception crashes value

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Cannot Reproduce
    • Icon: P3 P3
    • 9
    • 9
    • tools
    • None

      -> class D { public String toString() { throw new RuntimeException(); } }
      | Added class D

      -> new D()
      | State engine terminated.
      | Restore definitions with: /reload restore
      Exception in thread "main" java.lang.RuntimeException
              at REPL.$REPL12$D.toString($REPL12.java:7)
              at jdk.internal.jshell.remote.RemoteAgent.valueString(jdk.jshell@9-internal/RemoteAgent.java:263)
              at jdk.internal.jshell.remote.RemoteAgent.commandLoop(jdk.jshell@9-internal/RemoteAgent.java:137)
              at jdk.internal.jshell.remote.RemoteAgent.main(jdk.jshell@9-internal/RemoteAgent.java:61)
      | Expression value is:
      | assigned to temporary variable $4 of type D

      -> $4
      | Error:
      | cannot find symbol
      | symbol: variable $4
      | $4
      | ^^

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

              Created:
              Updated:
              Resolved: