RFR: 8325152: Clarify specification of java.io.RandomAccessFile.setLength [v2]

Alan Bateman alanb at openjdk.org
Sat Feb 3 09:13:01 UTC 2024


On Fri, 2 Feb 2024 16:48:12 GMT, Brian Burkhalter <bpb at openjdk.org> wrote:

>> Modify the specification verbiage of `java.io.RandomAccessFile.setLength` to account for the effect of the method on the file offset as returned by `getFilePointer`.
>
> Brian Burkhalter has updated the pull request incrementally with one additional commit since the last revision:
> 
>   8325152: Minor change to paragraph about file offset

Marked as reviewed by alanb (Reviewer).

src/java.base/share/classes/java/io/RandomAccessFile.java line 682:

> 680:      * @param      newLength    The desired length of the file
> 681:      * @throws     IOException  If the argument is negative or
> 682:      *                          if some other I/O error occurs

Throwing IOException when the newLength is negative is unfortunate but long standing behavior that can't be changed. So I think the proposed text looks okay. I can review the CSR when you have it ready.

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

PR Review: https://git.openjdk.org/jdk/pull/17679#pullrequestreview-1860957960
PR Review Comment: https://git.openjdk.org/jdk/pull/17679#discussion_r1477026772


More information about the core-libs-dev mailing list