Steve Lawrence created DAFFODIL-3073:
----------------------------------------

             Summary: Use of varargs in serialized classes can lead to reload 
incompatablities
                 Key: DAFFODIL-3073
                 URL: https://issues.apache.org/jira/browse/DAFFODIL-3073
             Project: Daffodil
          Issue Type: Bug
          Components: Front End
            Reporter: Steve Lawrence
             Fix For: 4.2.0


Daffodil implements saved parsers by just serializing the DataProcessor. 
Although Scala guarantees binary compatibility, it does not guarantee 
serialization compatibility. This means that if you serialize a saved processor 
using one version of Scala and try to reload it on another version of scala, 
it's possible things could break. In practice, this doesn't seem to break 
things with Daffodil usage of the scala library and things we happen to 
serialize--most classes we use are written to be compatible.

One type where this isn't the case is with scala's ArraySeq. This type does not 
implement serialVersionUID so any changes to the class could lead to a new UID 
and incompatibilities.

We don't intentionally use ArraySeq directly in any of our serialized classes, 
but scala implements vararg using ArraySeq. For example, if you have this class:

{code:scala}
class Foo(args: Type*) \{ ... }
{code}

And try to serialize it, you will end up with serialized ArraySeq. 

We do use this in one specific place, in CompiledDPath:
{code}





--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to