Do not use ObjectStreamClass.lookupAny() to resolve interfaces
Fixes #130
This commit is contained in:
parent
f38bf74f3e
commit
f779a4415c
@ -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);
|
||||
|
@ -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 {
|
||||
|
Loading…
Reference in New Issue
Block a user