stevedlawrence commented on a change in pull request #326: Daffodil 2280 
cleanup - removes backpointers and factory patterns no longer needed
URL: https://github.com/apache/incubator-daffodil/pull/326#discussion_r393641876
 
 

 ##########
 File path: 
daffodil-core/src/main/scala/org/apache/daffodil/dsom/ElementBase.scala
 ##########
 @@ -502,41 +495,58 @@ trait ElementBase
   private lazy val implicitAlignmentInBits: Int = 
getImplicitAlignmentInBits(primType, impliedRepresentation)
 
   final lazy val alignmentValueInBits: JInt = {
-    alignment match {
-      case AlignmentType.Implicit => {
-        if (this.isComplexType) 
this.complexType.modelGroup.alignmentValueInBits
-        else implicitAlignmentInBits
+    val alignInBits: JInt =
+      alignment match {
+        case AlignmentType.Implicit => {
+          if (this.isComplexType) 
this.complexType.modelGroup.alignmentValueInBits
+          else implicitAlignmentInBits
+        }
+        case align: JInt => {
+          val alignInBits: JInt = this.alignmentUnits match {
+            case AlignmentUnits.Bits => align
+            case AlignmentUnits.Bytes => 8 * align
+          }
+          alignInBits
+        }
       }
-      case align: JInt => {
-        val alignInBits: JInt = this.alignmentUnits match {
-          case AlignmentUnits.Bits => align
-          case AlignmentUnits.Bytes => 8 * align
+    if ((alignment ne AlignmentType.Implicit) && this.isSimpleType) {
 
 Review comment:
   Looks like this was changed to add ``alignment ne AlignmentType.Implicit``. 
What does this check only apply for explicit alignment?

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