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

jshell tool: pasting multiple lines of code truncated

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: P3
    • Resolution: Fixed
    • Affects Version/s: 9
    • Fix Version/s: 10
    • Component/s: tools
    • Labels:
    • Subcomponent:
    • Resolved In Build:
      b21
    • OS:
      os_x

      Description


      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

        Attachments

          Activity

            People

            • Assignee:
              jlahoda Jan Lahoda
              Reporter:
              rfield Robert Field
            • Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: