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

jshell tool: pasting multiple lines of code truncated

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: P3 P3
    • 10
    • 9
    • tools
    • b21
    • os_x


      I just tried to paste this code into JShell

      public class Account {
         private String name; // instance variable
       
         // method to set the name in the object
         public void setName(String name) {
            this.name = name; // store the name
         }

         // method to retrieve the name from the object
         public String getName() {
            return name; // return value of name to caller
         }
      }

      In Windows it works fine. On macOS Sierra, it stops after the first two lines of code and leaves me sitting at a continuation prompt.

      Both on JDK 9 build 173. I have not tested Linux.

      I tried it with and without the comments just in case, but it works with and without them on Windows and gives the same problem upon encountering the blank line in macOS.

      Best,
      Paul

      I can reproduce on MacBook Pro running Yosemite.
      Robert

            jlahoda Jan Lahoda
            rfield Robert Field (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: