< prev index next >

src/java.base/share/classes/java/io/File.java

Print this page

        

*** 2215,2224 **** --- 2215,2225 ---- * The separator character is saved also so it can be replaced * in case the path is reconstituted on a different host type. * * @serialData Default fields followed by separator character. */ + @java.io.Serial private synchronized void writeObject(java.io.ObjectOutputStream s) throws IOException { s.defaultWriteObject(); s.writeChar(separatorChar); // Add the separator character
*** 2228,2237 **** --- 2229,2239 ---- * readObject is called to restore this filename. * The original separator character is read. If it is different * than the separator character on this system, then the old separator * is replaced by the local separator. */ + @java.io.Serial private synchronized void readObject(java.io.ObjectInputStream s) throws IOException, ClassNotFoundException { ObjectInputStream.GetField fields = s.readFields(); String pathField = (String)fields.get("path", null);
*** 2249,2258 **** --- 2251,2261 ---- = UNSAFE.objectFieldOffset(File.class, "path"); private static final long PREFIX_LENGTH_OFFSET = UNSAFE.objectFieldOffset(File.class, "prefixLength"); /** use serialVersionUID from JDK 1.0.2 for interoperability */ + @java.io.Serial private static final long serialVersionUID = 301077366599181567L; // -- Integration with java.nio.file -- private transient volatile Path filePath;
< prev index next >