Review JDK-8010837 - TEST_BUG: java/io/FileInputStream/ fails intermittently

Mandy Chung mandy.chung at
Wed Mar 27 01:29:25 UTC 2013

Hi Dan,

On 3/26/2013 12:29 PM, Dan Xu wrote:
> Hi All,
> In the old JVM function, os::available, it could return negative 
> values because lseek() allows the file offset to be set beyond the end 
> of a file. In the previous change of removing jvm functions, I wasn't 
> aware of that and regard negative values as invalid and return 0, 
> which causes this test failed if it handles negative values. This fix 
> addressed this problem and added a new testcase to ensure the correct 
> behaviour when available() encounters negative values.
> Webrev:

This change looks okay to me.  The spec of FileInputStream.available() 
doesn't say the returned value is non-negative and your fix restores the 
previous behavior and so this is fine.

I suggest to update the synposis of 8010837 to reflect that it's a bug 
in the implementation rather than a test bug.


More information about the core-libs-dev mailing list