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

Small typos in JShell method SnippetEvent.toString()

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: P4 P4
    • 25
    • 25
    • tools
    • None
    • b13
    • generic
    • generic

      There are a few small typos in SnippetEvent.toString():

      * There is a missing equals sign in the display of the "causeSnippet"
      * There is a missing comma before the display of "value"
      * There is a missing comma before the display of "exception"

      Demonstration setup:

          $ jshell
          | Welcome to JShell -- Version 23
          | For an introduction type: /help intro
          
          jshell> var jsh = jdk.jshell.JShell.builder().build();
          jsh ==> jdk.jshell.JShell@551bdc27

      Demonstration of first problem:
          
          jshell> jsh.eval("*").get(0)
          $10 ==> SnippetEvent(snippet=Snippet:ErroneousKey#9*,previousStatus=NONEXISTENT,status=REJECTED,isSignatureChange=false,causeSnippetnull)

      Demonstration of second problem:
          
          jshell> jsh.eval("123").get(0)
          $9 ==> SnippetEvent(snippet=Snippet:VariableKey($2)#8-123,previousStatus=NONEXISTENT,status=VALID,isSignatureChange=true,causeSnippetnullvalue=123)

      Demonstration of third problem:

          jshell> jsh.eval("throw new Exception(\"foo2\");").get(0)
          $8 ==> SnippetEvent(snippet=Snippet:StatementKey#7-throw new Exception("foo2");,previousStatus=NONEXISTENT,status=VALID,isSignatureChange=true,causeSnippetnullexception=jdk.jshell.EvalException: foo2)

            acobbs Archie Cobbs
            acobbs Archie Cobbs
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: