Skip to content

Commit

Permalink
make LoggedReporter fields lazy
Browse files Browse the repository at this point in the history
I get NPE when I extend ManagedLoggedReporter if I don't do this.
  • Loading branch information
eed3si9n committed Sep 25, 2017
1 parent 50b00c7 commit 264ffc5
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -101,9 +101,9 @@ class LoggedReporter(
sourcePositionMapper: Position => Position = identity[Position]
) extends Reporter {
import sbt.util.InterfaceUtil.{ toSupplier => f0 }
val positions = new mutable.HashMap[PositionKey, Severity]
val count = new EnumMap[Severity, Int](classOf[Severity])
protected val allProblems = new mutable.ListBuffer[Problem]
lazy val positions = new mutable.HashMap[PositionKey, Severity]
lazy val count = new EnumMap[Severity, Int](classOf[Severity])
protected lazy val allProblems = new mutable.ListBuffer[Problem]
reset()

def reset(): Unit = {
Expand Down

0 comments on commit 264ffc5

Please sign in to comment.