diff --git a/src/share/classes/java/io/File.java b/src/share/classes/java/io/File.java index 846ddc3004dd25ddb02b61433d9c86c18052d95e..ad1978a97948a0d2c4dae59bcc8b7d8ea70a01ac 100644 --- a/src/share/classes/java/io/File.java +++ b/src/share/classes/java/io/File.java @@ -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; } /**