-
CSR
-
Resolution: Withdrawn
-
P4
-
None
-
behavioral
-
low
-
It is a static block and runs once when it is loaded into JVM. It did not alter the original workflow.
-
Implementation
Summary
Print out warning message when user specified java.io.tmpdir does not exist
Problem
When the directory of java.io.tmpdir is used as a file directory, but it is not set properly, the java.io.IOException is thrown with a generic error message of " No such file or directory". This message would not be able to give a hint to the developer about the configuration of java.io.tmpdir. See JDK-8290313.
Solution
Add a static block of the code in the inner class TempDirectory of java.io.File.java and TempFileHelper.java. It will print out an error message when java.io.tmpdir is not a valid directory.
Specification
static block of the code inside inner class TempDirectory in File.java
// print out the error message for java.io.tmpdir setting
static {
if (tmpdir.isInvalid() || !fs.hasBooleanAttributes(tmpdir, FileSystem.BA_DIRECTORY)) {
System.err.println("WARNING: java.io.tmpdir location does not exist");
}
}
static block of the code inside class java.nio.file.TempFileHelper.java
// print out the error message for java.io.tmpdir setting
static {
if (!Files.isDirectory(tmpdir)) {
System.err.println("WARNING: java.io.tmpdir location does not exist");
}
}
- clones
-
JDK-8291891 Throw error if default java.security file is missing
- Closed