[#452] CompactObjectInputStream fails to resolve interfaces

This commit is contained in:
Trustin Lee 2012-07-13 13:02:09 +09:00
parent 787f5b28b2
commit 6c2eba79d7

View File

@ -37,7 +37,8 @@ class CompactObjectOutputStream extends ObjectOutputStream {
@Override @Override
protected void writeClassDescriptor(ObjectStreamClass desc) throws IOException { protected void writeClassDescriptor(ObjectStreamClass desc) throws IOException {
Class<?> clazz = desc.forClass(); Class<?> clazz = desc.forClass();
if (clazz.isPrimitive() || clazz.isArray() || desc.getSerialVersionUID() == 0) { if (clazz.isPrimitive() || clazz.isArray() || clazz.isInterface() ||
desc.getSerialVersionUID() == 0) {
write(TYPE_FAT_DESCRIPTOR); write(TYPE_FAT_DESCRIPTOR);
super.writeClassDescriptor(desc); super.writeClassDescriptor(desc);
} else { } else {