RFR: 8290313: Produce warning when user specified java.io.tmpdir directory doesn't exist [v4]

Roger Riggs rriggs at openjdk.org
Fri Oct 14 21:03:55 UTC 2022


On Fri, 14 Oct 2022 19:25:54 GMT, Weibing Xiao <duke at openjdk.org> wrote:

>> 8290313: Produce warning when user specified java.io.tmpdir directory doesn't exist
>
> Weibing Xiao has updated the pull request with a new target base due to a merge or a rebase. The pull request now contains 11 commits:
> 
>  - Merge branch 'master' into improve-directory-not-existing-error-message
>  - new approach: print warning in StaticProperty.java
>  - Merge branch 'master' into improve-directory-not-existing-error-message
>  - add the change for nio and update the code according to the comments
>  - new approach
>  - change based on the review
>  - updating according to the comments
>  - Merge branch 'master' of https://github.com/openjdk/jdk into improve-directory-not-existing-error-message
>  - update error message
>  - error message for non-existing directory
>  - ... and 1 more: https://git.openjdk.org/jdk/compare/8487c56f...2da71bdc

The check for the tmp directory should be delayed until it is the property is used.
If temp files are not used, it only increases startup time without any benefit (usually the directory exists).

Putting the check and printing a warning in the static initialization of Files.TempDirectory will
delay its evaluation until it is needed and the initialization order in System will not need to be changed.
Changing the initialization order is always has some risks.

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

PR: https://git.openjdk.org/jdk/pull/9989


More information about the core-libs-dev mailing list