|
Kristian Waagan made changes - 20/Feb/09 08:38 AM
Patch 1a fixes the bug and adds a regression test. I think there is at least one more bug in the class, I'll investigate later.
Note that the regression test will cause a hang if the fix is removed. Patch ready for review. Running the regression suite.
Kristian Waagan made changes - 20/Feb/09 10:09 AM
Kristian Waagan made changes - 20/Feb/09 10:11 AM
Kristian Waagan made changes - 20/Feb/09 10:14 AM
I think there is one tiny problem with the patch, but I haven't actually tested that it is a problem. I believe that in this code
+ if (remaining == 0 && len != 0) { + return -1; + } (len != 0) should be replaced with (len > 0). Otherwise, we return -1 when len is negative instead of throwing an IndexOutOfBoundsException. In the test there's a typo (infinit -> infinite), and the variable n is unused. Regression tests passed without failures on Solaris 10, Java SE 6.
Thanks for the review and the comments, Knut.
Patch 1b addresses the comments. Committed to trunk with revision 746236.
Kristian Waagan made changes - 20/Feb/09 01:49 PM
Kristian Waagan made changes - 20/Feb/09 01:49 PM
Backported fix to 10.4 with revision 747393 and to 10.3 with revision 747395.
Kristian Waagan made changes - 24/Feb/09 02:34 PM
Tinderbox tests for 10.4 and 10.3 ran successfully.
This issue can be verified and, if found to be fixed, closed by the reporter.
Myrna van Lunteren made changes - 04/May/09 06:22 PM
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
The problem in UpdatableBlobStream, is that the underlying source is asked to read zero bytes, which it does... The calling code fails to handle this scenario, which is a valid one seen from InputStream (from JavaDoc: "If len is zero, then no bytes are read and 0 is returned; otherwise, there is an attempt to read at least one byte.").