Skip to content

Commit 5f9b1cf

Browse files
committed
remove workaround from sqlDateError.sc test
1 parent 2de80eb commit 5f9b1cf

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

compiler/src/dotty/tools/runner/ScalaClassLoader.scala

+2-2
Original file line numberDiff line numberDiff line change
@@ -62,12 +62,12 @@ object ScalaClassLoader {
6262
def setContext(cl: ClassLoader) = Thread.currentThread.setContextClassLoader(cl)
6363

6464
def fromURLsParallelCapable(urls: Seq[URL], parent: ClassLoader | Null = null): URLClassLoader =
65-
new URLClassLoader(urls.toArray, if parent == null then ClassLoader.getSystemClassLoader.getParent else parent)
65+
new URLClassLoader(urls.toArray, if parent == null then bootClassLoader else parent)
6666

6767
@sharable private[this] val bootClassLoader: ClassLoader =
6868
if scala.util.Properties.isJavaAtLeast("9") then
6969
try
70-
MethodHandles.lookup().findStatic(classOf[ClassLoader], "getPlatformClassLoader", MethodType.methodType(classOf[ClassLoader])).invoke().asInstanceOf[ClassLoader]
70+
ClassLoader.getSystemClassLoader.getParent
7171
catch case _: Throwable => null
7272
else null
7373

compiler/test-resources/scripting/sqlDateError.sc

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#!bin/scala -nosave
1+
#!bin/scala
22

33
def main(args: Array[String]): Unit = {
44
println(new java.sql.Date(100L))

0 commit comments

Comments
 (0)