This is an automated email from the ASF dual-hosted git repository.

slawrence pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/daffodil.git


The following commit(s) were added to refs/heads/main by this push:
     new 32bc90ffb Avoid possible serialization issues related to ArraySeq
32bc90ffb is described below

commit 32bc90ffb6ae31960831388a7d00b2f790d42e77
Author: Steve Lawrence <[email protected]>
AuthorDate: Fri Feb 20 12:22:30 2026 -0500

    Avoid possible serialization issues related to ArraySeq
    
    The ArraySeq class has been known to cause deserialization failures
    related to saving/reloading parsers because the class is written in a
    way as to cause serialization sensitivity to changes in the class.
    
    We don't use ArraySeq in any of our serialized classes, but Scala
    implements varargs using ArraySeq, and we do use varargs in the
    serialized CompiledDPath class. This can make serialized objects
    sensitive to different versions of Scala if they make changes to the
    class.
    
    We do not need any of the features provided by ArraySeq or varargs, so
    this converts the ops member of CompiledDPath to an Array, avoiding
    potential deserialzation issues with future versions of Daffodil.
    
    DAFFODIL-3073
---
 .../scala/org/apache/daffodil/runtime1/dpath/DPathRuntime.scala     | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git 
a/daffodil-core/src/main/scala/org/apache/daffodil/runtime1/dpath/DPathRuntime.scala
 
b/daffodil-core/src/main/scala/org/apache/daffodil/runtime1/dpath/DPathRuntime.scala
index 19a2a79cd..7a4479614 100644
--- 
a/daffodil-core/src/main/scala/org/apache/daffodil/runtime1/dpath/DPathRuntime.scala
+++ 
b/daffodil-core/src/main/scala/org/apache/daffodil/runtime1/dpath/DPathRuntime.scala
@@ -17,7 +17,6 @@
 
 package org.apache.daffodil.runtime1.dpath
 
-import scala.collection.immutable.ArraySeq
 import scala.xml.NodeSeq.seqToNodeSeq
 
 import org.apache.daffodil.lib.exceptions.Assert
@@ -42,9 +41,10 @@ import 
org.apache.daffodil.runtime1.processors.VariableException
 import org.apache.daffodil.runtime1.processors.VariableHasNoValue
 import org.apache.daffodil.runtime1.processors.VariableRuntimeData
 
-class CompiledDPath(val ops: RecipeOp*) extends Serializable {
+class CompiledDPath(val ops: Array[RecipeOp]) extends Serializable {
 
-  def this(ops: List[RecipeOp]) = this(ArraySeq.unsafeWrapArray(ops.toArray)*)
+  def this(ops: RecipeOp*) = this(ops.toArray)
+  def this(ops: List[RecipeOp]) = this(ops.toArray)
 
   override def toString =
     toXML.toString

Reply via email to