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

JShell hangs if pasted code has new line feed and causes a warning

XMLWordPrintable

    • b135
    • 9
    • generic
    • generic

      FULL PRODUCT VERSION :
      java version "9-ea"
      Java(TM) SE Runtime Environment (build 9-ea+143)
      Java HotSpot(TM) 64-Bit Server VM (build 9-ea+143, mixed mode)

      ADDITIONAL OS VERSION INFORMATION :
      CentOS 7, Linux 3.10.0-327.36.3.el7.x86_64

      A DESCRIPTION OF THE PROBLEM :
      I'm currently testing OpenJDK 9-ea+143 64-bit on a Linux System (CentOS 7).
      JShell is awesome, so I'm testing and playing with it.

      Now I found a situation where JShell hangs reproducible:
      1. Open JShell
      2. Paste the following code including line feed after the second line so both should be executed:
      final BigDecimal balance = new BigDecimal("1500000")
      final BigDecimal repayment = new BigDecimal("0")

      or

      final BigDecimal balance = new BigDecimal("1500000");
      final BigDecimal repayment = new BigDecimal("0");

      The first line ("final") causes a warning. After the warning the shell prompt is displayed, but no further input is possible. JShell hangs, can't be stopped with Ctrl-C, the only option is to kill the process on another shell session.

      STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
      1. Open JShell
      2. Paste the following code including line feed after the second line so both should be executed:
      final BigDecimal balance = new BigDecimal("1500000")
      final BigDecimal repayment = new BigDecimal("0")

      or

      final BigDecimal balance = new BigDecimal("1500000");
      final BigDecimal repayment = new BigDecimal("0");

      EXPECTED VERSUS ACTUAL BEHAVIOR :
      EXPECTED -
      Further input to JShell should be possible
      ACTUAL -
      JShell hangs

      REPRODUCIBILITY :
      This bug can be reproduced always.

      CUSTOMER SUBMITTED WORKAROUND :
      Kill JShell process from another shell session

            rfield Robert Field (Inactive)
            webbuggrp Webbug Group
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: