On Wed, 4 Nov 2026 14:05:19 GMT, Volkan Yazici <[email protected]> wrote:

>> Fix `RandomAccessFile#skipBytes(int)` and overhaul associated tests.
>> 
>> ### Testing notes
>> 
>> `SkipBytes` has gone through a major facelift.
>> 
>> - Past EOF `getFilePointer()` check was broken, fixed in f15ccfaf.
>> - `new RandomAccessFile("input.txt" , "rw")` was not working at all. File 
>> needed to be passed via `new File(System.getProperty("test.src", "."), 
>> "input.txt")`. Fixed in f4300dbb.
>> - `input.txt` doesn't need to be VCS-tracked. Removed it in f4300dbb.
>> - Extended the tests to reproduce the issue, see 049ae7c5. New cases are 
>> cloned from 46d34868 delivered in [JDK-8394316].
>> - Migrated the tests to JUnit, see 02ac947c.
>> 
>> [JDK-8394316]: https://bugs.openjdk.org/browse/JDK-8394316
>> 
>> ---------
>> - [X] I confirm that I make this contribution in accordance with the 
>> [OpenJDK Interim AI Policy](https://openjdk.org/legal/ai).
>
> Volkan Yazici has updated the pull request incrementally with four additional 
> commits since the last revision:
> 
>  - Simplify position check after skip
>  - Improve final position & read assertion in test
>  - Rename test's `expectedPosition` to `initialPosition`
>  - Move file creation to `test()`

test/jdk/java/io/RandomAccessFile/SkipBytes.java line 59:

> 57:                     size + 1,
> 58:                     Integer.MAX_VALUE - 1,
> 59:                     Integer.MAX_VALUE

Why not try some long-exclusive values here like Long.MAX_VALUE - 1L?

-------------

PR Review Comment: https://git.openjdk.org/jdk/pull/33649#discussion_r4484477978

Reply via email to