On Tue, 1 Dec 2026 09:12:52 GMT, Volkan Yazici <[email protected]> wrote:
>> This patch overrides toString() in FileInputStream, FileOutputStream, and >> RandomAccessFile to return the file's base name followed by its identity >> hash. It follows similar changes made a few years ago for ZipFile >> (JDK-8319626). >> >> Filename retrieval shares the existing File.getName() logic, while streams >> constructed from a file descriptor retain their previous behaviour. >> >> --------- >> - [X] I confirm that I make this contribution in accordance with the >> [OpenJDK Interim AI Policy](https://openjdk.org/legal/ai). > > test/jdk/java/io/FileInputStream/ToString.java line 1: > >> 1: /* > > As expected, this test fails against the upstream. Put another way, we change > the `toString()` behavior for `FileInputStream`, `FileOutputStream`, > `RandomAccessFile`, and potentially all classes extending from them. Are > there any backward compatibility issues that we should be concerned about? > \cc @AlanBateman It's good to think about subclassing but assuming the format is not specified then I don't have concerns. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/34137#discussion_r4755954392
