Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 6f1ac0a

Browse files
authored
Merge pull request scala#11044 from SethTisue/fix-jdk-24
Fix JDK 24+ by removing more exit calls
2 parents 284deea + e4cb099 commit 6f1ac0a

File tree

4 files changed

+6
-5
lines changed

4 files changed

+6
-5
lines changed

test/files/pos/t7591/Demo.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ object DemoSpec extends DemoSpec with Property {
4747
type ThisCommandLine = SpecCommandLine
4848
def creator(args: List[String]) =
4949
new SpecCommandLine(args) {
50-
override def errorFn(msg: String) = { println("Error: " + msg) ; sys.exit(0) }
50+
override def errorFn(msg: String) = { throw new Error("Error: " + msg) }
5151
}
5252
}
5353

test/files/presentation/random/src/Random.scala

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -63,8 +63,8 @@ object randomserver {
6363
}
6464
catch {
6565
case e: IOException =>
66-
System.err.println("Could not listen on port: 9999.");
67-
System.exit(-1)
66+
System.err.println("Could not listen on port: 9999.")
67+
throw e
6868
}
6969
}
7070

test/files/run/fail-non-value-types.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,6 @@ object Test {
3535
println(map.info)
3636
println(map.infoIn(cil))
3737
println(distinct.info)
38-
if (failed) sys.exit(1)
38+
assert(!failed)
3939
}
4040
}

test/files/run/verify-ctor.scala

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,12 @@
11
class Foo(val str: String) {
22
def this(arr: Array[Char]) = this({
3-
if (arr.length == 0) sys.exit(1)
3+
if (arr.length == 0) Test.quit(1)
44
new String(arr)
55
})
66
}
77

88
object Test {
9+
def quit(s: Int): Nothing = ???
910
def main(args: Array[String]) = {
1011
val t = new Foo(Array('a', 'b', 'c'))
1112
println(t.str)

0 commit comments

Comments
 (0)