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

Externalizer classes can get jumbled

    XMLWordPrintable

Details

    • Bug
    • Resolution: Done
    • Major
    • 1.1.0.CR1
    • None
    • River
    • None
    • Workaround Exists
    • Hide

      Always return the same Externalizer from an ExternalizerFactory for an object of a given class.

      Show
      Always return the same Externalizer from an ExternalizerFactory for an object of a given class.
    • Medium

    Description

      Since Externalizers are selected by instance, there can arise a situation where an ExternalizerFactory would, for whatever reason, return two different Externalizer instances for two different objects of the same class. Since the externalizer is typically written with the class, and classes are only written one time, the second and subsequent Externalizers will be ignored and the first Externalizer will be used to unmarshal the object on the remote end. This isn't necessarily incorrect; just confusing.

      The proper fix would be to introduce a new interface, ClassExternalizerFactory, which has a method:

      Externalizer getExternalizer(Class<?> clazz);

      Then add a corresponding property to MarshallerConfiguration, and deprecate ExternalizerFactory and its config properties. Then, implementations can prefer the new interface to the old, or even try both. Eventually ExternalizerFactory can then be removed.

      Wire protocol should be unaffected by this change.

      Attachments

        Issue Links

          Activity

            People

              dlloyd@redhat.com David Lloyd
              dlloyd@redhat.com David Lloyd
              Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: