-
Notifications
You must be signed in to change notification settings - Fork 114
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix NPE in TestRunSession#toString and use AtomicReference
currently if one calls TestRunSession#toString (e.g. in a debugger) a NPE can occur if the session is not yet started and the fStartTime is null. Also it is possible that fStartTime is concurrently set. This checks for this case adjust the message accordingly and also replace the volatile field with an AtomicReference to ensure the start time is only ever set by the first thread, alongside with that an unnecessary synchronized is removed from the method addTestSessionListener as ListenerList is already synchronized.
- Loading branch information
Showing
1 changed file
with
13 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters