RFR: JDK-8242919: Paste locks up jshell

Jan Lahoda jan.lahoda at oracle.com
Thu Apr 16 13:40:24 UTC 2020


Hi,

Pasting inside JShell causes JShell to lock up. The reason is that JLine 
detects the paste, and reads until an "end-of-paste" marker. This 
reading is done in blocks. But, as the streams are set-up in JShell, it 
will wait until the (last) block[1] is filled up before returning, but 
the user is not providing any input, expecting the paste to finish. The 
proposed solution is to make sure the InputStreams in JShell are set-up 
so that it does not wait until the block is filled.

Webrev: http://cr.openjdk.java.net/~jlahoda/8242919/webrev.00/
JBS: https://bugs.openjdk.java.net/browse/JDK-8242919

How does this look?

Thanks,
     Jan

[1] 
https://github.com/openjdk/jdk/blob/3cc1fdf2b60b388abdf53e8e053b9fab8f2f959c/src/jdk.internal.le/share/classes/jdk/internal/org/jline/utils/NonBlockingInputStream.java#L81


More information about the kulla-dev mailing list