Further UserDefinedFileAttributeView improvements and fixes

Sebastian Stenzel sebastian.stenzel at gmail.com
Tue Mar 2 15:13:59 UTC 2021


Following up on JDK-8260966, I'd like to propose two further (independent) changes:

1. Fail fast in UnixFileStore.isExtendedAttributesEnabled(UnixPath path) [1], if UnixNativeDispatcher.c is incapable of handling xattr, thus avoid unnecessary I/O.

2. Refactor UnixUserDefinedFileAttributeView.java with these goals:
- deduplicate code 
- reduce branching and improve readability
- fix leaking NativeBuffer by applying try-with-resource where applicable
- fix UnsupportedOperationException if trying to read to a Buffer that doesn't provide a backing array

I'd need someones assistance to create a bunch of issues for these tasks. I can provide an issue description on this mailing list, but I don't have access to the issue tracker.

Cheers!
Sebastian

[1]: https://github.com/openjdk/jdk/blob/0de6abd4b49e7111effbaef99a93317bcd7246f0/src/java.base/unix/classes/sun/nio/fs/UnixFileStore.java#L181


More information about the nio-dev mailing list