-
-
Notifications
You must be signed in to change notification settings - Fork 371
Open
Description
Steps to reproduce
- Install a JDK/JRE for Java 20 or later.
- Open an Ammonite REPL using that JDK/JRE (using Scala 3, but that isn't too relevant maybe)
- Run the line
while true do ()(Scala 3) - Attempt to Ctrl-C
- You should see
Exception in thread "SIGINT handler" java.lang.UnsupportedOperationException
at java.base/java.lang.Thread.stop(Thread.java:1705)
at ammonite.repl.Repl.$anonfun$action$5(Repl.scala:191)
at ammonite.repl.Signaller$$anon$1.handle(Signaller.scala:21)
at jdk.unsupported/sun.misc.Signal$InternalMiscHandler.handle(Signal.java:198)
at java.base/jdk.internal.misc.Signal$1.run(Signal.java:218)
at java.base/java.lang.Thread.run(Thread.java:1623)
because in Java 20 (https://docs.oracle.com/en/java/javase/20/docs/api/java.base/java/lang/Thread.html#stop()) the function has been "removed" and apparently should be replaced with Thread.interrupt and interruption checking/allowing on the execution thread.
The problematic line seems to be here:
| interp.mainThread.stop() |
Expected behavior
I expected to be able to interrupt long running programs, which was one of the advertised benefits of Ammonite-REPL.
Environment
Ammonite: 3.0.0-M0-53-084f7f4e
Scala: 3.3.1
Java: 20
bishabosha
Metadata
Metadata
Assignees
Labels
No labels