Even if the body of the if has only one statement, we should wrap it with  { }

    if (!executorToTasksActive.contains(eid)) {
      executorToTasksActive(eid) = HashSet[TaskInfo]()
    }

It makes the code much less error prone. 

One exception to this rule is for "tenary" operations that fit in a single line:
    
    if (condition) valueA else valueB