stevedlawrence commented on code in PR #1321:
URL: https://github.com/apache/daffodil/pull/1321#discussion_r1840302801
##########
daffodil-core/src/main/scala/org/apache/daffodil/core/dsom/SequenceGroup.scala:
##########
@@ -215,20 +216,37 @@ abstract class SequenceGroupTermBase(xml: Node,
lexicalParent: SchemaComponent,
}
}
- private lazy val checkMembersHaveUniqueNamesInNamespaces: Unit = {
- val childrenGroupedByQName = groupMembers.groupBy { gm =>
- // previous checks should ensure that all group members are either local
- // elements or element references
- Assert.invariant(gm.isInstanceOf[ElementBase])
- gm.asInstanceOf[ElementBase].namedQName
- }
- childrenGroupedByQName.foreach { case (qname, children) =>
- if (children.length > 1) {
+ private lazy val checkUnorderedSequenceMembersHaveUniqueNamesInNamespaces:
Unit = {
+ // previous checks should ensure that all group members for unordered
sequences are either local
+ // elements or element references
+ groupChildrenBy(_.namedQName)
Review Comment:
I forget why we added the `groupChildrenBy` function, but it only replaces
`elementChildren.groupBy`. The former isn't significantly shorter and I don't
think it is any more clear. Is it worth removing `groupChildrenBy`?
--
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.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]