mbeckerle commented on a change in pull request #214: Sequences and Separators 
Refactoring and Rewrite
URL: https://github.com/apache/incubator-daffodil/pull/214#discussion_r286575209
 
 

 ##########
 File path: 
daffodil-runtime1-unparser/src/main/scala/org/apache/daffodil/processors/unparsers/ZeroLengthDetector.scala
 ##########
 @@ -83,12 +151,34 @@ sealed trait StringZeroLengthMixin { self: 
ZeroLengthDetector =>
 class StringZeroLengthDetector
   extends ZeroLengthDetector
   with StringZeroLengthMixin {
-  override def isZeroLength(diElement: DIElement) = 
isStringZeroLength(diElement)
+  override def isKnownNonZeroLength(diElement: DIElement) = 
isStringKnownNonZeroLength(diElement)
+  override def isKnownZeroLength(diElement: DIElement) = 
isStringKnownZeroLength(diElement)
 
 }
 
 sealed trait HexBinaryZeroLengthMixin { self: ZeroLengthDetector =>
-  protected def isHexBinaryZeroLength(diElement: DIElement): Boolean = {
+
+  protected def isHexBinaryKnownNonZeroLength(diElement: DIElement): Boolean = 
{
+    val opt = diElement.erd.optPrimType
+    Assert.invariant(opt.isDefined & (opt.get eq NodeInfo.HexBinary))
+    val result =
+      if (diElement.isNilled)
+        true // must not be zero length nil. If it was zero length nil, we 
wouldn't be at this code.
 
 Review comment:
   Yes. I can pass hasNilZL as an argument, and test it here. 

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

Reply via email to