@@ -105,28 +105,29 @@ private[ui] class StagePage(parent: StagesTab, store: AppStatusStore) extends We
105105 val stageAttemptId = parameterAttempt.toInt
106106
107107 val stageHeader = s " Details for Stage $stageId (Attempt $stageAttemptId) "
108- var stageDataTuple : Tuple2 [StageData , Seq [Int ]] = null
109- try {
110- stageDataTuple = parent.store.stageAttempt(stageId, stageAttemptId, details = false )
108+ var stageDataTuple : Option [Tuple2 [StageData , Seq [Int ]]] = try {
109+ Some (parent.store.stageAttempt(stageId, stageAttemptId, details = false ))
111110 } catch {
112111 case e : NoSuchElementException => e.getMessage
112+ None
113113 }
114114 var stageData : StageData = null
115115 var stageJobIds : Seq [Int ] = null
116- if (stageDataTuple == null ) {
117- stageData = {
118- val content =
119- <div id =" no-info" >
120- <p >No information to display for Stage
121- {stageId}
122- (Attempt
123- {stageAttemptId})</p >
124- </div >
125- return UIUtils .headerSparkPage(request, stageHeader, content, parent)
126- }
127- } else {
128- stageData = stageDataTuple._1
129- stageJobIds = stageDataTuple._2
116+ stageDataTuple match {
117+ case Some (stageTuple) =>
118+ stageData = stageTuple._1
119+ stageJobIds = stageTuple._2
120+ case None =>
121+ stageData = {
122+ val content =
123+ <div id =" no-info" >
124+ <p >No information to display for Stage
125+ {stageId}
126+ (Attempt
127+ {stageAttemptId})</p >
128+ </div >
129+ return UIUtils .headerSparkPage(request, stageHeader, content, parent)
130+ }
130131 }
131132
132133 val localitySummary = store.localitySummary(stageData.stageId, stageData.attemptId)
0 commit comments