File tree 1 file changed +7
-13
lines changed
sbt-dotty/src/dotty/tools/sbtplugin
1 file changed +7
-13
lines changed Original file line number Diff line number Diff line change @@ -554,10 +554,8 @@ object DottyPlugin extends AutoPlugin {
554
554
* jline terminal. To do so we add the `appConfiguration` loader in
555
555
* the parent hierarchy of the scala 3 instance loader.
556
556
*
557
- * The [[FilteringClassLoader ]] ensures that the JNA, JDK and xsbti
558
- * classes only are loaded from the sbt loader. That is necessary because
559
- * the sbt class loader contains the Scala 2.12 library and compiler
560
- * bridge.
557
+ * The [[FilteringClassLoader ]] ensures that the classes from the
558
+ * Scala 2.12 library and compiler bridge are not loaded.
561
559
*/
562
560
val topLoader = new FilteringClassLoader (appConfiguration.provider.loader)
563
561
@@ -585,18 +583,14 @@ object DottyPlugin extends AutoPlugin {
585
583
}
586
584
587
585
private class FilteringClassLoader (parent : ClassLoader ) extends ClassLoader (parent) {
588
- private val prefixes = List (
589
- " xsbti." ,
590
- " org.jline." ,
591
- " java." ,
592
- " sun." ,
593
- " jdk.internal.reflect." ,
594
- " javax."
586
+ private val exludePackages = List (
587
+ " scala." ,
588
+ " xsbt."
595
589
)
596
590
597
591
override def loadClass (name : String , resolve : Boolean ): Class [_] = {
598
- if (prefixes .exists(name.startsWith(_))) super .loadClass(name, resolve)
599
- else null
592
+ if (exludePackages .exists(name.startsWith(_))) null
593
+ else super .loadClass(name, resolve)
600
594
}
601
595
602
596
override def getResource (name : String ): URL = {
You can’t perform that action at this time.
0 commit comments