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

JShell tool: Command change: re-run n-th command should be re-run by id

XMLWordPrintable

    • Icon: Enhancement Enhancement
    • Resolution: Fixed
    • Icon: P4 P4
    • 9
    • 9-repo-kulla
    • tools
    • b96
    • generic
    • generic
    • Verified

      I propose changing /<n> to /<id>.

      There is no one-to-one correspondence between n-th snippet and snippet id because we have the name space for main, startup and error.
      (Note: When the re-run command was implemented, we had just only one name space for any snippet)

      It makes re-run difficult.
      When we re-run main snippet, we have to add the number of startup snippets and the number of erroneous snippets which appear prior to the snippet what we want to re-run.
      It is very confusing for users.

      -> int n = 10
      | Added variable n of type int with initial value 10

      -> Math.sqrt(n)
      | Expression value is: 3.1622776601683795
      | assigned to temporary variable $2 of type double

      -> n = 30
      | Variable n has been assigned the value 30

      -> /list

         1 : int n = 10;
         2 : Math.sqrt(n)
         3 : n = 30

      -> /2
      import java.io.*;

      -> /list all

        s1 : import java.util.*;
        s2 : import java.io.*;
        s3 : import java.math.*;
        s4 : import java.net.*;
        s5 : import java.util.concurrent.*;
        s6 : import java.util.prefs.*;
        s7 : import java.util.regex.*;
        s8 : void printf(String format, Object... args) { System.out.printf(format, args); }
         1 : int n = 10;
         2 : Math.sqrt(n)
         3 : n = 30

      -> /10
      Math.sqrt(n)
      | Expression value is: 5.477225575051661
      | assigned to temporary variable $4 of type double

            shinyafox Shinya Yoshida
            shinyafox Shinya Yoshida
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved: