-
Bug
-
Resolution: Duplicate
-
P3
-
None
-
8u331
-
b06
-
x86_64
-
windows_10
ADDITIONAL SYSTEM INFORMATION :
Windows 7 / 10 / JRE 8u331
A DESCRIPTION OF THE PROBLEM :
After updating JRE 8 version version 202, to 331, new FileOutputStream("NUL:") shows "Invalid path or file name".
Original Method:
static {
NULL_FILE_CHANNEL = AccessController.doPrivileged(new PrivilegedAction < FileChannel > () {
public FileChannel run() {
final String osName = System.getProperty("os.name", "unknown").toLowerCase(Locale.US);
try {
if (osName.contains("windows")) {
return new FileOutputStream("NUL:").getChannel();
} else {
return new FileOutputStream("/dev/null").getChannel();
}
} catch (FileNotFoundException e) {
throw new IOError(e);
}
}
});
REGRESSION : Last worked in version 8
STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
try {
new FileOutputStream("NUL:").getChannel();
} catch (FileNotFoundException e) {
e.printStackTrace();
}
EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -
new FileOutputStream, to call method "getChannel()"
ACTUAL -
FileNotFoundException
FREQUENCY : always
Windows 7 / 10 / JRE 8u331
A DESCRIPTION OF THE PROBLEM :
After updating JRE 8 version version 202, to 331, new FileOutputStream("NUL:") shows "Invalid path or file name".
Original Method:
static {
NULL_FILE_CHANNEL = AccessController.doPrivileged(new PrivilegedAction < FileChannel > () {
public FileChannel run() {
final String osName = System.getProperty("os.name", "unknown").toLowerCase(Locale.US);
try {
if (osName.contains("windows")) {
return new FileOutputStream("NUL:").getChannel();
} else {
return new FileOutputStream("/dev/null").getChannel();
}
} catch (FileNotFoundException e) {
throw new IOError(e);
}
}
});
REGRESSION : Last worked in version 8
STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
try {
new FileOutputStream("NUL:").getChannel();
} catch (FileNotFoundException e) {
e.printStackTrace();
}
EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -
new FileOutputStream, to call method "getChannel()"
ACTUAL -
FileNotFoundException
FREQUENCY : always
- duplicates
-
JDK-8285445 cannot open file "NUL:"
- Closed
-
JDK-8285445 cannot open file "NUL:"
- Closed