1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52
|
/*
* @test /nodynamiccopyright/
* @bug 8202056
* @compile/ref=Extern.out -XDrawDiagnostics -Xlint:serial Extern.java
* @compile/ref=empty.out -XDrawDiagnostics Extern.java
*/
import java.io.*;
class Extern implements Externalizable {
private static final long serialVersionUID = 42;
// No-arg constructor on an Externalizable class must be public
protected Extern() {}
// ineffectual
private static final ObjectStreamField[] serialPersistentFields = {};
public void writeExternal(ObjectOutput out) throws IOException {
return;
}
public void readExternal(ObjectInput in) throws IOException, ClassNotFoundException {
return;
}
// ineffectual
private void readObject(ObjectInputStream stream)
throws IOException, ClassNotFoundException {
stream.defaultReadObject();
}
// ineffectual
private void writeObject(ObjectOutputStream stream) throws IOException {
stream.defaultWriteObject();
}
// ineffectual
private void readObjectNoData() throws ObjectStreamException {
return;
}
// (possibly) effective
private Object writeReplace() throws ObjectStreamException {
return null;
}
// (possibly) effective
private Object readResolve() throws ObjectStreamException {
return null;
}
}
|