RFR: 8360887: (fs) Files.getFileAttributeView returns unusable FileAttributeView if UserDefinedFileAttributeView unavailable (aix) [v4]

Alan Bateman alanb at openjdk.org
Tue Jul 1 06:32:45 UTC 2025


On Mon, 30 Jun 2025 20:57:54 GMT, Martin Doerr <mdoerr at openjdk.org> wrote:

>> We need to fix this wrong behavior on AIX and the test should catch it. Please review!
>> 
>> Returning null is required: https://github.com/openjdk/jdk/blob/c2d76f9844aadf77a0b213a9169a7c5c8c8f1ffb/src/java.base/share/classes/java/nio/file/spi/FileSystemProvider.java#L924
>
> Martin Doerr has updated the pull request incrementally with one additional commit since the last revision:
> 
>   Fix typo in comment.

src/java.base/aix/classes/sun/nio/fs/AixFileSystemProvider.java line 57:

> 55:     static boolean supportsUserDefinedFileAttributeView(Path obj) {
> 56:         try {
> 57:             FileStore store = Files.getFileStore(obj);

This needs to be `new AixFileStore(obj)` rather than `Files.getFileStore` to avoid cycles. It might be that no one on AIX replaces the default provider but always have to avoid making use of the API in the API implementation.

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

PR Review Comment: https://git.openjdk.org/jdk/pull/26021#discussion_r2176536674


More information about the nio-dev mailing list