Github user cloud-fan commented on a diff in the pull request: https://github.com/apache/spark/pull/19556#discussion_r146759438 --- Diff: core/src/main/scala/org/apache/spark/util/ClosureCleaner.scala --- @@ -91,6 +91,50 @@ private[spark] object ClosureCleaner extends Logging { (seen - obj.getClass).toList } + /** Initializes the accessed fields for outer classes and their super classes. */ + private def initAccessedFields( + accessedFields: Map[Class[_], Set[String]], + outerClasses: Seq[Class[_]]): Unit = { + for (cls <- outerClasses) { + var currentClass = cls + do { --- End diff -- I feel it's better to use `while` loop here. Programmatically the loop requires `currentClass != null`, even for the first loop. To completely keep the previous behavior, we can add a `assert(cls != null)` before the loop.
--- --------------------------------------------------------------------- To unsubscribe, e-mail: reviews-unsubscr...@spark.apache.org For additional commands, e-mail: reviews-h...@spark.apache.org