Skip to content

Commit

Permalink
Update Class.forName to org.apache.spark.util.Utils.classForName to
Browse files Browse the repository at this point in the history
avoid problems with classloaders
  • Loading branch information
Jeffrharr committed Jul 10, 2015
1 parent 33d3179 commit 233335d
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion core/src/main/scala/org/apache/spark/SparkContext.scala
Original file line number Diff line number Diff line change
Expand Up @@ -1968,7 +1968,7 @@ class SparkContext(config: SparkConf) extends Logging with ExecutorAllocationCli
for (className <- listenerClassNames) {
// Use reflection to find the right constructor
val constructors = {
val listenerClass = Class.forName(className)
val listenerClass = org.apache.spark.util.Utils.classForName(className)
listenerClass.getConstructors.asInstanceOf[Array[Constructor[_ <: SparkListener]]]
}
val constructorTakingSparkConf = constructors.find { c =>
Expand Down

0 comments on commit 233335d

Please sign in to comment.