mirror of
https://github.com/openjdk/jdk.git
synced 2025-08-27 06:45:07 +02:00
8231314: java.time serialization warning cleanup
Reviewed-by: chegar, naoto, plevart
This commit is contained in:
parent
f8bb7b3a26
commit
725031769f
4 changed files with 75 additions and 42 deletions
|
@ -68,6 +68,7 @@ import java.io.IOException;
|
|||
import java.io.InvalidClassException;
|
||||
import java.io.ObjectInput;
|
||||
import java.io.ObjectOutput;
|
||||
import java.io.Serializable;
|
||||
import java.io.StreamCorruptedException;
|
||||
import java.time.ZoneOffset;
|
||||
|
||||
|
@ -97,7 +98,7 @@ final class Ser implements Externalizable {
|
|||
/** The type being serialized. */
|
||||
private byte type;
|
||||
/** The object being serialized. */
|
||||
private Object object;
|
||||
private Serializable object;
|
||||
|
||||
/**
|
||||
* Constructor for deserialization.
|
||||
|
@ -111,7 +112,7 @@ final class Ser implements Externalizable {
|
|||
* @param type the type
|
||||
* @param object the object
|
||||
*/
|
||||
Ser(byte type, Object object) {
|
||||
Ser(byte type, Serializable object) {
|
||||
this.type = type;
|
||||
this.object = object;
|
||||
}
|
||||
|
@ -183,12 +184,13 @@ final class Ser implements Externalizable {
|
|||
object = readInternal(type, in);
|
||||
}
|
||||
|
||||
static Object read(DataInput in) throws IOException, ClassNotFoundException {
|
||||
static Serializable read(DataInput in) throws IOException, ClassNotFoundException {
|
||||
byte type = in.readByte();
|
||||
return readInternal(type, in);
|
||||
}
|
||||
|
||||
private static Object readInternal(byte type, DataInput in) throws IOException, ClassNotFoundException {
|
||||
private static Serializable readInternal(byte type, DataInput in)
|
||||
throws IOException, ClassNotFoundException {
|
||||
switch (type) {
|
||||
case ZRULES:
|
||||
return ZoneRules.readExternal(in);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue