I don't believe that SparkEnv is ever directly exposed to non-Scala code, so is there a good reason to use a nullable var instead of var executorIdToHostPort: Option[(String, String) => String] initialized to None here, with the null check in resolveExecutorIdToHostPort becoming Option.getOrElse?  (Ideally, I'd also like to see stronger typing than 'String', but it is pretty late in the game to start requiring that level of type safety in Spark.)