Uploaded image for project: 'Daffodil'
  1. Daffodil
  2. DFDL-823

Need clear error message when using string with maxOccurs="unbounded" occursCountKind="implicit" w/o maxLength specified

    XMLWordPrintableJSON

    Details

      Description

      While working on DFDL-732, I was unaware that when creating a string element with maxOccurs="unbounded" and occursCountKind="implicit" you are required to speicify the max/minLength facets. Currently, if you don't it results in a very large, unhelpful stack trace:

      [error] Test edu.illinois.ncsa.daffodil.section14.occursCountKind.TestOCKImplicitNew.test_ockImplicit7 failed: edu.illinois.ncsa.daffodil.processors.ParseError: Parse Error: StringFixedLengthInBytesFixedWidthCharacters - Exception:
      [error] edu.illinois.ncsa.daffodil.processors.DFDLByteReader.getByteArray(DFDLReader.scala:105)
      [error] edu.illinois.ncsa.daffodil.processors.InStreamFromByteChannel.getByteAlignedBytes(InStream.scala:246)
      [error] edu.illinois.ncsa.daffodil.processors.InStreamFromByteChannel.getBytes(InStream.scala:208)
      [error] edu.illinois.ncsa.daffodil.processors.StringLengthInBytes.parseInput(PrimitivesLengthKind.scala:161)
      [error] edu.illinois.ncsa.daffodil.processors.StringLength$$anon$1$$anonfun$parse$1.apply(PrimitivesLengthKind.scala:48)
      [error] edu.illinois.ncsa.daffodil.processors.StringLength$$anon$1$$anonfun$parse$1.apply(PrimitivesLengthKind.scala:38)
      [error] edu.illinois.ncsa.daffodil.processors.WithParseErrorThrowing$class.withParseErrorThrowing(Parser.scala:223)
      [error] edu.illinois.ncsa.daffodil.processors.PrimParser.withParseErrorThrowing(ProcessorBases.scala:9)
      [error] edu.illinois.ncsa.daffodil.processors.StringLength$$anon$1.parse(PrimitivesLengthKind.scala:38)
      [error] edu.illinois.ncsa.daffodil.processors.Parser.parse1(Parser.scala:135)
      [error] edu.illinois.ncsa.daffodil.processors.SeqCompParser$$anonfun$parse$3.apply(Parser.scala:336)
      [error] edu.illinois.ncsa.daffodil.processors.SeqCompParser$$anonfun$parse$3.apply(Parser.scala:334)
      [error] scala.collection.LinearSeqOptimized$class.foreach(LinearSeqOptimized.scala:59)
      [error] scala.collection.immutable.List.foreach(List.scala:76)
      ..............................

        Gliffy Diagrams

          Attachments

            Activity

              People

              Assignee:
              Unassigned Unassigned
              Reporter:
              jadams Joshua Adams
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

                Dates

                Created:
                Updated:

                  Tasks

                  Progress: 
                   0/0