Further UserDefinedFileAttributeView improvements and fixes

Brian Burkhalter brian.burkhalter at oracle.com
Wed Mar 24 00:42:13 UTC 2021


> On Mar 10, 2021, at 9:23 AM, Sebastian Stenzel <sebastian.stenzel at gmail.com> wrote:
> 
> Is there no way to review increments? After all, JDK-8262958 addresses several related tasks. All we would need is a way to review individual commits instead of the PR as a whole.
> 
> But yes, we certainly can subdivide it further: I'd need you to replace JDK-8262958 by a three more issues:
> 
> 1. Deduplicate code around `flistxattr` calls inside of UnixUserDefinedFileAttributeView.java

Perhaps JDK-8262958 can be revised to cover only this #1 as no PR has yet been filed?

> 2. Fix UnsupportedOperationException when passing a ByteBuffer without a backing array to `UnixUserDefinedFileAttributeView.read(String name, ByteBuffer dst)`
> 3. Use try-with-resource for all NativeBuffers within UnixUserDefinedFileAttributeView, fixing leak when opening a file for read/write attr fails (in lines [1] and [2])
> 4. Reorder methods/constructor/fields in UnixUserDefinedFileAttributeView.java

Sebastian, do you have JBS access yet so that you could file these other three? Also there was mentioned in the PR [A] for [B] about filing another issue for the close(-1) case.

[A] https://github.com/openjdk/jdk/pull/2816#discussion_r587801192
[B] https://bugs.openjdk.java.net/browse/JDK-8262957

> [1]: https://github.com/openjdk/jdk/blob/7e52a6e8b37412b43b0024ca067959100c14f508/src/java.base/unix/classes/sun/nio/fs/UnixUserDefinedFileAttributeView.java#L187 <https://github.com/openjdk/jdk/blob/7e52a6e8b37412b43b0024ca067959100c14f508/src/java.base/unix/classes/sun/nio/fs/UnixUserDefinedFileAttributeView.java#L187>
> [2]: https://github.com/openjdk/jdk/blob/7e52a6e8b37412b43b0024ca067959100c14f508/src/java.base/unix/classes/sun/nio/fs/UnixUserDefinedFileAttributeView.java#L258 <https://github.com/openjdk/jdk/blob/7e52a6e8b37412b43b0024ca067959100c14f508/src/java.base/unix/classes/sun/nio/fs/UnixUserDefinedFileAttributeView.java#L258>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mail.openjdk.java.net/pipermail/nio-dev/attachments/20210323/0c04dfcb/attachment.htm>


More information about the nio-dev mailing list