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

Alan Bateman alanb at openjdk.org
Mon Jun 30 10:05:39 UTC 2025


On Fri, 27 Jun 2025 16:24:20 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 two additional commits since the last revision:
> 
>  - Update Copyright years.
>  - Add bug id to test.

test/jdk/java/nio/file/attribute/UserDefinedFileAttributeView/Basic.java line 288:

> 286:                 if (Files.getFileAttributeView(dir, UserDefinedFileAttributeView.class) != null) {
> 287:                     throw new RuntimeException("UserDefinedFileAttributeView not supported, getFileAttributeView should return null");
> 288:                 }

This is the test for UserDefinedFileAttributeView, it's not meant to be a test for the FileSystemProvider. getFileAttributeView methods. So I think we need to see if there is an existing test that should be updated, or maybe a new test will need to be added.

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

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


More information about the nio-dev mailing list