Program: 43026
Project: 43026
Buggy source:
private void writeNewPlainClassDesc(final Class<?> forClass) throws IOException {
  write(TC_CLASSDESC);
  writeUTF(classResolver.getClassName(forClass));
  descriptorCache.put(forClass,instanceSeq++);
  if (forClass.isEnum()) {
    writeLong(0L);
    write(SC_SERIALIZABLE | SC_ENUM);
    writeShort(0);
  }
 else   if (Serializable.class.isAssignableFrom(forClass)) {
    final SerializableClass sc=registry.lookup(forClass);
    final long svu=sc.getEffectiveSerialVersionUID();
    writeLong(svu);
    if (Externalizable.class.isAssignableFrom(forClass)) {
      write(SC_EXTERNALIZABLE + SC_BLOCK_DATA);
      writeShort(0);
    }
 else {
      if (sc.hasWriteObject()) {
        write(SC_WRITE_METHOD + SC_SERIALIZABLE);
      }
 else {
        write(SC_SERIALIZABLE);
      }
      final SerializableField[] fields=sc.getFields();
      writeShort(fields.length);
      for (      SerializableField field : fields) {
        final SerializableField.Kind kind=field.getKind();
        final String name=field.getName();
        final Class<?> type;
        try {
          type=field.getType();
        }
 catch (        ClassNotFoundException e) {
          throw new InvalidClassException(forClass.getName(),"String_Node_Str" + name + "String_Node_Str");
        }
        if (kind != SerializableField.Kind.OBJECT) {
          write(primitives.get(type,-1));
          writeUTF(name);
        }
      }
      for (      SerializableField field : fields) {
        final SerializableField.Kind kind=field.getKind();
        final String name=field.getName();
        final Class<?> type;
        try {
          type=field.getType();
        }
 catch (        ClassNotFoundException e) {
          throw new InvalidClassException(forClass.getName(),"String_Node_Str" + name + "String_Node_Str");
        }
        if (kind == SerializableField.Kind.OBJECT) {
          final String signature=getSignature(type);
          write(signature.charAt(0));
          writeUTF(name);
          writeObject(signature);
        }
      }
    }
  }
 else {
    writeLong(0L);
    write(0);
    writeShort(0);
  }
  classResolver.annotateClass(blockMarshaller,forClass);
  doEndBlock();
  final Class<?> sc=forClass.getSuperclass();
  if (Serializable.class.isAssignableFrom(sc)) {
    writeClassDescFor(sc);
  }
 else {
    write(TC_NULL);
  }
}

Fixed version (ground truth):
private void writeNewPlainClassDesc(final Class<?> forClass) throws IOException {
  write(TC_CLASSDESC);
  writeUTF(classResolver.getClassName(forClass));
  descriptorCache.put(forClass,instanceSeq++);
  if (forClass.isEnum()) {
    writeLong(0L);
    write(SC_SERIALIZABLE | SC_ENUM);
    writeShort(0);
  }
 else   if (Serializable.class.isAssignableFrom(forClass)) {
    final SerializableClass sc=registry.lookup(forClass);
    final long svu=sc.getEffectiveSerialVersionUID();
    writeLong(svu);
    if (Externalizable.class.isAssignableFrom(forClass)) {
      write(SC_EXTERNALIZABLE + SC_BLOCK_DATA);
      writeShort(0);
    }
 else {
      if (sc.hasWriteObject()) {
        write(SC_WRITE_METHOD + SC_SERIALIZABLE);
      }
 else {
        write(SC_SERIALIZABLE);
      }
      final SerializableField[] fields=sc.getFields();
      writeShort(fields.length);
      for (      SerializableField field : fields) {
        final Kind kind=field.getKind();
        final String name=field.getName();
        final Class<?> type;
        try {
          type=field.getType();
        }
 catch (        ClassNotFoundException e) {
          throw new InvalidClassException(forClass.getName(),"String_Node_Str" + name + "String_Node_Str");
        }
        if (kind != Kind.OBJECT) {
          write(primitives.get(type,-1));
          writeUTF(name);
        }
      }
      for (      SerializableField field : fields) {
        final Kind kind=field.getKind();
        final String name=field.getName();
        final Class<?> type;
        try {
          type=field.getType();
        }
 catch (        ClassNotFoundException e) {
          throw new InvalidClassException(forClass.getName(),"String_Node_Str" + name + "String_Node_Str");
        }
        if (kind == Kind.OBJECT) {
          final String signature=getSignature(type);
          write(signature.charAt(0));
          writeUTF(name);
          writeObject(signature);
        }
      }
    }
  }
 else {
    writeLong(0L);
    write(0);
    writeShort(0);
  }
  classResolver.annotateClass(blockMarshaller,forClass);
  doEndBlock();
  final Class<?> sc=forClass.getSuperclass();
  if (Serializable.class.isAssignableFrom(sc)) {
    writeClassDescFor(sc);
  }
 else {
    write(TC_NULL);
  }
}