@@ -132,12 +132,11 @@ private[scalatest] object ConcurrentDocumenter {
132
132
//
133
133
private [scalatest] class MessageRecorder (dispatch : Reporter ) extends ThreadAwareness {
134
134
135
- @ volatile private var messages = List [(String , Option [Any ], RecordedMessageEventFun , Option [Location ])]()
135
+ private var messages = List .empty [(String , Option [Any ], RecordedMessageEventFun , Option [Location ])]
136
136
137
137
// Returns them in order recorded
138
- private def recordedMessages : List [(String , Option [Any ], RecordedMessageEventFun , Option [Location ])] = synchronized {
139
- messages.reverse
140
- }
138
+ private def recordedMessages : List [(String , Option [Any ], RecordedMessageEventFun , Option [Location ])] =
139
+ synchronized { messages.reverse }
141
140
142
141
def apply (message : String , payload : Option [Any ], eventFun : RecordedMessageEventFun , location : Option [Location ]): Unit = {
143
142
requireNonNull(message, payload)
@@ -147,10 +146,8 @@ private[scalatest] class MessageRecorder(dispatch: Reporter) extends ThreadAware
147
146
}
148
147
149
148
def recordedEvents (testWasPending : Boolean , testWasCanceled : Boolean ): collection.immutable.IndexedSeq [RecordableEvent ] = {
150
- synchronized {
151
- Vector .empty ++ recordedMessages.map { case (message, payload, eventFun, location) =>
152
- eventFun(message, payload, true , testWasPending, testWasCanceled, location)
153
- }
149
+ Vector .empty ++ recordedMessages.map { case (message, payload, eventFun, location) =>
150
+ eventFun(message, payload, true , testWasPending, testWasCanceled, location)
154
151
}
155
152
}
156
153
}
0 commit comments