Do not use ObjectStreamClass.lookupAny() to resolve interfaces
Fixes #130
This commit is contained in:
parent
8145ad96f6
commit
c6ef712503
@ -55,8 +55,6 @@ class CompactObjectInputStream extends ObjectInputStream {
|
||||
case CompactObjectOutputStream.TYPE_THIN_DESCRIPTOR:
|
||||
String className = readUTF();
|
||||
Class<?> clazz = classResolver.resolve(className);
|
||||
|
||||
// change lookupAny to lookup as lookupAny is only supported in java6
|
||||
return ObjectStreamClass.lookup(clazz);
|
||||
default:
|
||||
throw new StreamCorruptedException(
|
||||
|
@ -19,6 +19,7 @@ import java.io.IOException;
|
||||
import java.io.ObjectOutputStream;
|
||||
import java.io.ObjectStreamClass;
|
||||
import java.io.OutputStream;
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
*/
|
||||
@ -39,7 +40,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…
x
Reference in New Issue
Block a user