jadams-tresys commented on a change in pull request #440:
URL: https://github.com/apache/incubator-daffodil/pull/440#discussion_r506643334



##########
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:
       I've pushed up a change with what I think is a more clear warning 
message:
   Multiple choice branches with no required elements detected, selecting the 
first branch for unparsing




----------------------------------------------------------------
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]


Reply via email to