[ https://issues.apache.org/jira/browse/IO-867?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17927568#comment-17927568 ]
Gary D. Gregory commented on IO-867: ------------------------------------ Hello [~ciskyper] Thank you for your research and feedback. I added the following tests in git master: - {{org.apache.commons.io.output.ThresholdingOutputStreamTest.testResetByteCount()}} - {{org.apache.commons.io.output.ThresholdingOutputStreamTest.testResetByteCountBrokenOutputStream()}} Does that answer your question? Feel free to add more tests for partial writes in a PR or here. TY > Fix ThresholdingOutputStream#isThresholdExceeded > ------------------------------------------------ > > Key: IO-867 > URL: https://issues.apache.org/jira/browse/IO-867 > Project: Commons IO > Issue Type: Bug > Components: Streams/Writers > Affects Versions: 2.18.0 > Environment: Java > Reporter: Niels > Priority: Critical > > The ThresholdingOutputStream has a beautiful boolean field called > thresholdExceeded, yet the corresponding getter returns `written > threshold`. > This means after `#thresholdReached()`, the next time `#getStream()` is > called the 'threshold getter' returns false! > This causes very inconsistent behavior... -- This message was sent by Atlassian Jira (v8.20.10#820010)