stevedlawrence commented on a change in pull request #155: Don't require
binaryNumberRep for hexBinary
URL: https://github.com/apache/incubator-daffodil/pull/155#discussion_r241199003
##########
File path:
daffodil-core/src/main/scala/org/apache/daffodil/dsom/ElementBase.scala
##########
@@ -653,13 +653,16 @@ trait ElementBase
}
}
+ private lazy val optionBinaryNubmerRep =
findPropertyOption("binaryNumberRep")
+
private def getImplicitAlignmentInBits(thePrimType: PrimType,
theRepresentation: Representation): Int = {
(theRepresentation, thePrimType) match {
case (Representation.Text, PrimType.HexBinary) =>
Assert.impossible("type xs:hexBinary with representation='text'")
case (Representation.Text, _) => knownEncodingAlignmentInBits
case (Representation.Binary, PrimType.Float | PrimType.Boolean) => 32
case (Representation.Binary, PrimType.Double) => 64
- case (Representation.Binary, _) => binaryNumberRep match {
+ case (Representation.Binary, PrimType.HexBinary) => 8
+ case (Representation.Binary, _) if (optionBinaryNumberRep.isDefined) =>
binaryNumberRep match {
Review comment:
Is the optionBinaryNumberRep.isDefine check needed here? If the prim type is
hexBInary it'll hit the new case you added and will never try to get
optionBInaryNumberRep, I think? There's also a case PrimType.HexBinary => 8 at
the bottom of this match case that I think is impossible to hit with the above
change? Hard to tell with this complex nesting of match cases...
----------------------------------------------------------------
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:
[email protected]
With regards,
Apache Git Services