-
Type:
Bug
-
Resolution: Unresolved
-
Priority:
P3
-
Affects Version/s: 25
-
Component/s: core-libs
There has been a change in the behaviour of RandomAccessFile in Java 25. Before Java 25, a call to RandomAccessFile.readLine() would call read() on that same instance. However, starting Java 25, that no longer seems to be the case. This has an unforeseen impact on subclasses of RandomAccessFile.
Attached is a reproducer which trivially reproduces an issue where a subclass of RandomAccessFile eagerly reads and buffers the file content to return that buffered content from calls to read(). However, since readLine() no longer calls read(), the call to readLine() ends up returning null (even when there is buffered content in the subclass).
The attached reproducer completes normally in Java 24 but fails on Java 25.
This looks a side effect of the change done inJDK-8361640.
Attached is a reproducer which trivially reproduces an issue where a subclass of RandomAccessFile eagerly reads and buffers the file content to return that buffered content from calls to read(). However, since readLine() no longer calls read(), the call to readLine() ends up returning null (even when there is buffered content in the subclass).
The attached reproducer completes normally in Java 24 but fails on Java 25.
This looks a side effect of the change done in
- caused by
-
JDK-8361640 JFR: RandomAccessFile::readLine emits events for each character
-
- Resolved
-