Review JDK-8010837 - TEST_BUG: java/io/FileInputStream/LargeFileAvailable.java fails intermittently
Mandy Chung
mandy.chung at oracle.com
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: http://cr.openjdk.java.net/~dxu/8010837/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.
Mandy
More information about the core-libs-dev
mailing list