提交 54b26037 编写于 作者: A aeubanks

8229899: Make java.io.File.isInvalid() less racy

Reviewed-by: alanb, martin, shade
上级 c03f0ca7
......@@ -183,11 +183,13 @@ public class File
* @return true if the file path is invalid.
*/
final boolean isInvalid() {
if (status == null) {
status = (this.path.indexOf('\u0000') < 0) ? PathStatus.CHECKED
: PathStatus.INVALID;
PathStatus s = status;
if (s == null) {
s = (this.path.indexOf('\u0000') < 0) ? PathStatus.CHECKED
: PathStatus.INVALID;
status = s;
}
return status == PathStatus.INVALID;
return s == PathStatus.INVALID;
}
/**
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册