-
-
Notifications
You must be signed in to change notification settings - Fork 2k
Fix stop watch thread safety #606
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix stop watch thread safety #606
Conversation
LGTM - @brasmusson can you merge this one in please? |
I'll take care of it. |
Merged. Thanks for your effort @davebassan |
Long duration = System.nanoTime() - start; | ||
start = null; | ||
Long duration = System.nanoTime() - start.get(); | ||
start.set(null); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
May be the start.remove()
is more appropriate.
I'm hitting (I believe) this same issue running parallel tests in junit+cucumber-spring. java.lang.NullPointerException I'm just wondering if/when the fix likely to make it into a future release? |
This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
Running the cucumber tests in parallel results in a NullPointerException being thrown by the StopWatch stop method as it is not thread safe.
I added a test to replicate the issue and have updated the StopWatch class to be thread safe.