case '[': {
fieldType = Object.class;
break;
}
default: {
throw new StreamCorruptedException("Invalid field typecode " + typecodes[i]);
}
}
fields[i] = sc.getSerializableField(names[i], fieldType, false);
}
descriptor = new PlainDescriptor(clazz, bridge(superDescr, superClazz), fields, descFlags);
}
} else {
throw new InvalidClassException(clazz.getName(), "Class hierarchy mismatch");
}
instanceCache.set(idx, descriptor);
return descriptor;
}
case TC_PROXYCLASSDESC: {
final int idx = instanceCache.size();
instanceCache.add(UNRESOLVED);
final int cnt = readInt();
final String[] interfaces = new String[cnt];
for (int i = 0; i < interfaces.length; i++) {
interfaces[i] = readUTF();
}
final Class<?> clazz = classResolver.resolveProxyClass(blockUnmarshaller, interfaces);
blockUnmarshaller.readToEndBlockData();
blockUnmarshaller.unblock();
final Descriptor superDescr = readClassDescriptor();
final ProxyDescriptor descr = new ProxyDescriptor(clazz, superDescr, interfaces);
instanceCache.set(idx, descr);
return descr;
}
case TC_NULL: {
return null;
}
case TC_REFERENCE: {
try {
return (Descriptor) readBackReference(readInt());
} catch (ClassCastException e) {
throw new StreamCorruptedException("Backreference was not a resolved class descriptor");
}
}
case TC_EXCEPTION: {
clearInstanceCache();
final IOException ex = (IOException) doReadObject(false);