jadams-tresys commented on a change in pull request #262: Unordered sequences
URL: https://github.com/apache/incubator-daffodil/pull/262#discussion_r318627474
##########
File path:
daffodil-runtime1/src/main/scala/org/apache/daffodil/infoset/InfosetImpl.scala
##########
@@ -1415,6 +1415,10 @@ sealed class DIComplex(override val erd:
ElementRuntimeData, val tunable: Daffod
}
}
+ final def sortChildNodesByPosition(): Unit = {
+ childNodes = childNodes.sortBy(_.erd.position)
+ }
Review comment:
We do have test case for unordered sequences nested inside ordered
namespaces and they do sort correctly. Also, as far as I can tell it is only
sorting the child nodes in the unordered sequence.
As for sorting in place, that is originally what I wanted to do and there is
a sortInPlace for ArrayBuffer in Scala 2.13, but it is not available in 2.12.3
(or whatever version we are currently using.) I'm not sure what our plans are
for upgrading to Scala 2.13, but I'm not sure it is worth it to work around
this instead of just waiting til we upgrade to 2.13.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services