mbeckerle commented on a change in pull request #88: Daffodil 1919 separators
URL: https://github.com/apache/incubator-daffodil/pull/88#discussion_r209006648
 
 

 ##########
 File path: 
daffodil-core/src/main/scala/org/apache/daffodil/dsom/ParticleMixin.scala
 ##########
 @@ -61,32 +79,40 @@ trait RequiredOptionalMixin { self: ElementBase =>
     res
   }.value
 
+  /**
+   * True if a "real" array, i.e., not an optional element, but something
+   * that can potentially have 2 or more occurrences based on maxOccurs
+   * and dfdl:occursCountKind that indicates whether maxOccurs will be 
respected.
+   */
   final override lazy val isArray = {
-    // maxOccurs > 1 || maxOccurs == -1
-
     if (isOptional) false
     else {
       val UNBOUNDED = -1
-      (optMinOccurs, optMaxOccurs) match {
-        case (None, None) => false
-        case (Some(1), Some(1)) => false
-        case (_, Some(n)) if n > 1 => true
-        case (_, Some(UNBOUNDED)) => true
+      (minOccurs, maxOccurs) match {
+        case (1, 1) => false
+        case (_, n) if n > 1 => true
+        case (_, UNBOUNDED) => true
         /**
          * This next case is for occursCountKinds parsed and stopValue.
          * These only use min/maxOccurs for validation, so anything
          * with these occursCountKinds is an array (so long as it isn't
          * scalar)
          */
-        case (_, Some(1)) if (occursCountKind == OccursCountKind.Parsed ||
+        case (_, 1) if (occursCountKind == OccursCountKind.Parsed ||
           occursCountKind == OccursCountKind.StopValue ||
           occursCountKind == OccursCountKind.Expression) => true
         case _ => false
       }
     }
   }
 
+  /**
+   * True if an array has at least one required element based
+   * on a minOccurs and a dfdl:occursCountKind that means that
+   * minOccurs will be respected.
+   */
   final lazy val isRequiredArrayElement = {
+    // TODO: rename to isArraywithAtLeastOneRequiredArrayElement
 
 Review comment:
   Done

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services

Reply via email to