dxbjavid opened a new pull request, #327: URL: https://github.com/apache/commons-math/pull/327
SynchronizedDescriptiveStatistics promises that every state-touching method is atomic on the instance, but removeMostRecentValue and replaceMostRecentValue are not overridden, so they mutate the shared backing array with no lock held. A thread calling either of them while another thread is inside a synchronised method like addValue or clear can therefore corrupt the underlying ResizableDoubleArray or trip an ArrayIndexOutOfBoundsException. I have overridden both to delegate under the instance monitor as the sibling mutators already do, and added a test that the calls block while the lock is held (it fails on master). -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
