google/jimfs

Files#readAttributes throws NullPointerException for non existent attribute view.

tzezula opened this issue · 0 comments

Files#readAttributes throws a NullPointerException for a nonexistent attribute view, but according to Javadoc, it should throw an UnsupportedOperationException.

Test case:

public static void main(String... args) throws IOException {
        try (java.nio.file.FileSystem nioFs1 = Jimfs.newFileSystem()) {
            Path test = nioFs1.getPath("test");
            Files.createFile(test);
            Files.readAttributes(test, "nonexistview:*");
        } catch (UnsupportedOperationException unsupported) {
            // expected
        }
    }