Uploaded image for project: 'JBoss Marshalling'
  1. JBoss Marshalling
  2. JBMAR-48

Marshalling discrepancy when using Externalizer and ClassTable.Writer being present

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Done
    • Icon: Major Major
    • 1.1.1.GA, 1.2.0.CR1
    • 1.0.0.GA, 1.0.1.GA, 1.1.0.GA
    • River
    • None
    • Low

      When you write an Externalizer class, RiverMarshaller (RM) does:

      writeExternalizerClass(objClass, externalizer);

      And inside it:

      ClassTable.Writer classTableWriter = classTable.getClassWriter(objClass);
      if (classTableWriter != null)

      { write(Protocol.ID_PREDEFINED_EXTERNALIZER_CLASS); classCache.put(objClass, classSeq++); writeClassTableData(objClass, classTableWriter); }

      else

      { write(Protocol.ID_EXTERNALIZER_CLASS); writeString(classResolver.getClassName(objClass)); classCache.put(objClass, classSeq++); doAnnotateClass(objClass); writeObject(externalizer); }

      Now, if I provide my own writer, it'll only write Protocol.ID_PREDEFINED_EXTERNALIZER_CLASS and writeClassTableData()

      On the reading side, in RiverUnmarshaller (RU), the following happens:

      case Protocol.ID_PREDEFINED_EXTERNALIZER_CLASS: {
      final int idx = classCache.size();
      classCache.add(null);
      final Class<?> type = readClassTableClass();
      final Externalizer externalizer = (Externalizer) readObject();

      And this means that RU expects the Externalize in the wire but RM didn't write it! This fails.

              dlloyd@redhat.com David Lloyd
              rh-ee-galder Galder ZamarreƱo
              Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

                Created:
                Updated:
                Resolved: