Github user pwendell commented on a diff in the pull request:

    https://github.com/apache/spark/pull/42#discussion_r10641868
  
    --- Diff: core/src/main/scala/org/apache/spark/SparkContext.scala ---
    @@ -1020,6 +1042,24 @@ class SparkContext(
       /** Register a new RDD, returning its RDD ID */
       private[spark] def newRddId(): Int = nextRddId.getAndIncrement()
     
    +  /** Post the environment update event if the listener bus is ready */
    +  private def postEnvironmentUpdate() {
    +    Option(listenerBus).foreach { bus =>
    --- End diff --
    
    If there is no normal case where it can be undefined, I'd rather just do 
`listenerBus.get`. In other words, I think it's not a great pattern to use 
`Option` to hide things that are actually code bugs. We should just use 
`Option` when there is a legitimate case where it hasn't been initialized.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---

Reply via email to