stevedlawrence commented on a change in pull request #440:
URL: https://github.com/apache/incubator-daffodil/pull/440#discussion_r506589457
##########
File path:
daffodil-core/src/main/scala/org/apache/daffodil/runtime1/ChoiceTermRuntime1Mixin.scala
##########
@@ -86,11 +86,15 @@ trait ChoiceTermRuntime1Mixin { self: ChoiceTermBase =>
// in the arriving infoset for unparse.
//
val optDefaultBranch = {
- val optEmpty: Option[Term] =
- groupMembers.find { gm =>
+ val optEmpty: Option[Term] = {
+ val emptyBranches = groupMembers.filter { gm =>
val ies = gm.identifyingEventsForChoiceBranch
ies.pnes.isEmpty // empty event list makes it the default, not
simply isOpen
}
+ if (emptyBranches.length > 1)
+ SDW(WarnID.MultipleChoiceBranches, "Multiple choice branches are
empty, defaulting to first empty branch")
Review comment:
Sounds to me like you're saying what would have made your problem more
clear would have been to get warning that choiceDispatch is ignored on
unparsing? I feel like that's type of thing is going to create too many
warnings. Just because the DFDL spec might not be intuitive doesn't necessarily
mean we should create warnings.
Or is the issue that you had multiple empty branches, and you thought in the
case of empty branch choicesDispatch was used to disambiguate? If that were the
case, I wonder if the suggested warnings would have led you to the realization
that choiceDispatch is ignored?
----------------------------------------------------------------
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]