RFR: 8316000: File.setExecutable silently fails if file does not exist [v6]

Alan Bateman alanb at openjdk.org
Tue Sep 26 07:43:12 UTC 2023


On Mon, 25 Sep 2023 20:25:41 GMT, Brian Burkhalter <bpb at openjdk.org> wrote:

>> On Windows, do not return `true` from the `java.io.File` methods `setReadable(boolean, boolean)` and `setExecutable(boolean, boolean)` if the file does not exist.
>
> Brian Burkhalter has updated the pull request incrementally with one additional commit since the last revision:
> 
>   8316000: Revert specification verbiage and modify @return description

The update in 2ec7d229 is good. I think we still have an issue with return description not taking account of the case where the platform doesn't support the operation, e.g. setReadable says that it returns "true if and only if the operation succeeded". This could be addressed by starting with the return description with something like "Where the platforms support setting a file's read permission ..." but that opens the door to further expanding for the case where file permissions aren't supported. I think I'm leaning towards expanding the methods descriptions to cover all the cases so that the return description can be removed to saying that it returns true when the operation succeeds, false if it fails, and the value of the parameter when not supported by the platform.

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

PR Comment: https://git.openjdk.org/jdk/pull/15673#issuecomment-1734998364


More information about the core-libs-dev mailing list