Skip to content

Commit

Permalink
[TOREE-558] ScalaInterpreter prefer to use context classloader (#225)
Browse files Browse the repository at this point in the history
Co-authored-by: Vincent Ye <vincent_ye@apple.com>
Co-authored-by: Cheng Pan <pan3793@gmail.com>
  • Loading branch information
3 people authored Nov 8, 2024
1 parent 82aaf23 commit 1e7e0c0
Showing 1 changed file with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,9 @@ class ScalaInterpreter(private val config:Config = ConfigFactory.load) extends I

protected val logger = LoggerFactory.getLogger(this.getClass.getName)

protected val _thisClassloader = this.getClass.getClassLoader
// honors caller's context classloader. If it isn't set, fall back to this class's classloader.
protected val _thisClassloader = Option(Thread.currentThread().getContextClassLoader)
.getOrElse(this.getClass.getClassLoader)

protected val lastResultOut = new ByteArrayOutputStream()

Expand Down

0 comments on commit 1e7e0c0

Please sign in to comment.