RFR: JDK-8262957 (fs) Fail fast in UnixFileStore.isExtendedAttributesEnabled

Sebastian Stenzel github.com+1204330+overheadhunter at openjdk.java.net
Thu Mar 4 15:30:40 UTC 2021


On Thu, 4 Mar 2021 15:15:00 GMT, Alan Bateman <alanb at openjdk.org> wrote:

> Style-wise, it might be a bit neater to use if (UnixNativeDispatcher.xattrSupported()) { ...} so there will only one "return false" code path.

I prefer to avoid nested blocks for improved readability, but thats mostly a matter of taste. If you like, I can reverse the "if".

> Looking at this code now make me wonder about the close(fd) for the case that the open fails. It should be checking if fd or there should be a nested try-finally so that close is only invoked when the open succeeds.

True. But I guess that would be off-topic in this PR?

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

PR: https://git.openjdk.java.net/jdk/pull/2816


More information about the nio-dev mailing list