Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Files#readAttributes throws NullPointerException for non existent attribute view. #212

Open
tzezula opened this issue Dec 14, 2022 · 0 comments
Labels
P3 type=defect Bug, not working as expected

Comments

@tzezula
Copy link

tzezula commented Dec 14, 2022

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
        }
    }
@cgdecker cgdecker added type=defect Bug, not working as expected P3 labels Dec 16, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
P3 type=defect Bug, not working as expected
Projects
None yet
Development

No branches or pull requests

2 participants