diff --git a/src/main/java/io/netty/handler/codec/serialization/CompactObjectInputStream.java b/src/main/java/io/netty/handler/codec/serialization/CompactObjectInputStream.java index baa9f16be1..7bfc0bfa7c 100644 --- a/src/main/java/io/netty/handler/codec/serialization/CompactObjectInputStream.java +++ b/src/main/java/io/netty/handler/codec/serialization/CompactObjectInputStream.java @@ -55,7 +55,7 @@ class CompactObjectInputStream extends ObjectInputStream { case CompactObjectOutputStream.TYPE_THIN_DESCRIPTOR: String className = readUTF(); Class clazz = classResolver.resolve(className); - return ObjectStreamClass.lookupAny(clazz); + return ObjectStreamClass.lookup(clazz); default: throw new StreamCorruptedException( "Unexpected class descriptor type: " + type); diff --git a/src/main/java/io/netty/handler/codec/serialization/CompactObjectOutputStream.java b/src/main/java/io/netty/handler/codec/serialization/CompactObjectOutputStream.java index d386ce3b72..2e88e7cc13 100644 --- a/src/main/java/io/netty/handler/codec/serialization/CompactObjectOutputStream.java +++ b/src/main/java/io/netty/handler/codec/serialization/CompactObjectOutputStream.java @@ -39,7 +39,7 @@ class CompactObjectOutputStream extends ObjectOutputStream { @Override protected void writeClassDescriptor(ObjectStreamClass desc) throws IOException { Class clazz = desc.forClass(); - if (clazz.isPrimitive() || clazz.isArray()) { + if (clazz.isPrimitive() || clazz.isArray() || desc.getSerialVersionUID() == 0) { write(TYPE_FAT_DESCRIPTOR); super.writeClassDescriptor(desc); } else {