Github user stevedlawrence commented on a diff in the pull request:

    https://github.com/apache/incubator-daffodil/pull/5#discussion_r151126478
  
    --- Diff: 
daffodil-core/src/main/scala/edu/illinois/ncsa/daffodil/dsom/LocalElementBase.scala
 ---
    @@ -29,50 +29,13 @@
      * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS 
WITH THE
      * SOFTWARE.
      */
    -
    -package edu.illinois.ncsa.daffodil.dsom
    -
    -trait LocalElementBase
    -  extends ElementBase
    -  with LocalElementMixin {
    -
    -  requiredEvaluations(checkForAlignmentAmbiguity)
    -
    -  private def gcd(a: Int, b: Int): Int = if (b == 0) a else gcd(b, a % b)
    -  //  private def lcm(a: Int, b: Int): Int = math.abs(a * b) / gcd(a, b)
    -  //  private def isXAMultipleOfY(x: Int, y: Int): Boolean = (x % y) == 0
    -
    -  //  private def isAlignmentCompatible(current: Int, next: Int): Boolean 
= {
    -  //    isXAMultipleOfY(current, next)
    -  //  }
    -
    -  /**
    -   * Changed to a warning - DFDL WG decided to make this check optional, 
but it
    -   * is still useful as a warning.
    -   *
    -   * Turns out that MIL STD 2045 header format needs to pad out to a byte 
boundary
    -   * at the end of the structure. An optional, non-byte aligned field 
precedes
    -   * the end of the structure; hence, putting a zero-length byte-aligned 
field
    -   * at the end was crashing into this error. I couldn't think of a 
work-around,
    -   * so changed this into a warning.
    -   *
    -   * The old requirement was:
    -   *   To avoid ambiguity when parsing, optional elements and 
variable-occurrence arrays
    -   *   where the minimum number of occurrences is zero cannot have 
alignment properties
    -   *   different from the items that follow them. It is a schema 
definition error otherwise.
    -   *
    -   * Part of the required evaluations for LocalElementBase.
    -   */
    -  final def checkForAlignmentAmbiguity: Unit = {
    -    if (isOptional) {
    -      this.possibleNextTerms.filterNot(m => m == this).foreach { that =>
    -        val isSame = this.alignmentValueInBits == that.alignmentValueInBits
    -        if (!isSame) {
    -          this.SDW("%s is an optional element or a variable-occurrence 
array and its alignment (%s) is not the same as %s's alignment (%s).",
    -            this.toString, this.alignmentValueInBits, that.toString, 
that.alignmentValueInBits)
    -        }
    -      }
    -    }
    -  }
    -
    -}
    +//
    +//package edu.illinois.ncsa.daffodil.dsom
    +//
    +//trait LocalElementBase
    +//  extends ElementBase
    +//  with LocalElementMixin {
    +//
    +//
    +//
    +//}
    --- End diff --
    
    Delete file?


---

Reply via email to