diff --git a/src/share/classes/java/io/File.java b/src/share/classes/java/io/File.java index 4f7a413839a754300ce7750a58e166895f1bfee0..12721567190e53e31aca62916e175a4fd04321bf 100644 --- a/src/share/classes/java/io/File.java +++ b/src/share/classes/java/io/File.java @@ -2064,11 +2064,12 @@ public class File private synchronized void readObject(java.io.ObjectInputStream s) throws IOException, ClassNotFoundException { - s.defaultReadObject(); + ObjectInputStream.GetField fields = s.readFields(); + String pathField = (String)fields.get("path", null); char sep = s.readChar(); // read the previous separator char if (sep != separatorChar) - this.path = this.path.replace(sep, separatorChar); - this.path = fs.normalize(this.path); + pathField = pathField.replace(sep, separatorChar); + this.path = fs.normalize(pathField); this.prefixLength = fs.prefixLength(this.path); }