RFR: 8305762: FileInputStream and FileOutputStream implSpec should be corrected or removed [v2]

Alan Bateman alanb at openjdk.org
Sat Apr 15 07:13:34 UTC 2023


On Fri, 14 Apr 2023 22:27:26 GMT, Brent Christian <bchristi at openjdk.org> wrote:

>> With the removal of the AltFinalizer mechanism from `FileInputStream` and `FileOutputStream` in [JDK-8192939](https://bugs.openjdk.org/browse/JDK-8192939), this portion of the Implementation Requirement in the class JavaDoc is no longer true:
>> 
>>> If this FileOutputStream has been subclassed and the close() method has been overridden, the close() method will be called when the FileInputStream is unreachable."
>> 
>> The class doc, and the doc for close(), are updated to correctly reflect current behavior, and guidance for subclasses is clarified.
>
> Brent Christian has updated the pull request incrementally with one additional commit since the last revision:
> 
>   updates, per review comments

Marked as reviewed by alanb (Reviewer).

src/java.base/share/classes/java/io/FileInputStream.java line 45:

> 43:  * @apiNote
> 44:  * The {@link #close} method should be called to release resources used by this
> 45:  * stream, either directly, or by try-with-resources.

The updated wording looks much better. It pre-dates your change but maybe "or by try-with-resources" should be changed to "with the {@code try}-with-resources statement" while you are there.

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

PR Review: https://git.openjdk.org/jdk/pull/13437#pullrequestreview-1386351626
PR Review Comment: https://git.openjdk.org/jdk/pull/13437#discussion_r1167412577


More information about the core-libs-dev mailing list