RFR: 8360887: (fs) Files.getFileAttributeView returns unusable FileAttributeView if UserDefinedFileAttributeView unavailable (aix) [v4]
Alan Bateman
alanb at openjdk.org
Tue Jul 1 06:46: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 72:
> 70: if (type == UserDefinedFileAttributeView.class) {
> 71: return !supportsUserDefinedFileAttributeView(obj) ? null :
> 72: (V) new AixUserDefinedFileAttributeView(UnixPath.toUnixPath(obj), Util.followLinks(options));
I think should this be inverted, meaning use supportsUserDefinedFileAttributeView instead of ! supportsUserDefinedFileAttributeView and it will be clear to read.
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/26021#discussion_r2176561100
More information about the nio-dev
mailing list