[ 
https://issues.apache.org/jira/browse/DAFFODIL-2211?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Dave Thompson closed DAFFODIL-2211.
-----------------------------------

Verified the specified commits (commits 
17f3fa8a1206f8801ab96a262f2219fb3eb6c72f, 
be6058009172af19ddddc52570dc1ceff20043f9 and 
19eb2a371fdeeece8afa2c53d103d474cbbe30da) are included in the latest pull from 
the daffodil repository.

Verified, via review, changes identified in the commit comment were 
implemented. 

Verified the affected daffodil subproject sbt test suites executed successfully 
including the added test.

> Poor handling when dfdlx:repType is a built-in xsd type
> -------------------------------------------------------
>
>                 Key: DAFFODIL-2211
>                 URL: https://issues.apache.org/jira/browse/DAFFODIL-2211
>             Project: Daffodil
>          Issue Type: Bug
>          Components: Front End
>    Affects Versions: 2.4.0
>            Reporter: Brandon Sloane
>            Assignee: Steve Lawrence
>            Priority: Major
>             Fix For: 3.5.1
>
>         Attachments: TestCSV.scala, b.dfdl.xsd, c.dfdl.xsd, csv.tdml, 
> csvDetailed.dfdl.xsd, simpleCSVDetailed.csv, simpleCSVDetailed.xml
>
>
> Attached are two cases, both of which contain:
> {quote}<xs:simpleType name="SomeEnumType" dfdlx:repType="xs:unsignedByte">
>  <xs:restriction base="xs:unsignedShort">
>  <xs:enumeration value="55" dfdlx:repValues="0" />
>  <xs:enumeration value="56" dfdlx:repValues="1" />
>  <xs:enumeration value="57" dfdlx:repValues="2" />
>  </xs:restriction>
> </xs:simpleType>
> {quote}
> In some cases this could potentially make sense (eg. when the document format 
> is such that unsignedByte is automatically 8 bits), but we probably want to 
> disallow this entirely.
> In b.dfdl.xsd, the entire document is using representation='text'. This fails 
> with a somewhat reasonable error:
> {quote}[error] Schema Definition Error: Type UnsignedShort with 
> dfdl:representation='text' cannot have dfdl:lengthKind='implicit'
> Schema context: element reference tns:a Location line 1 in 
> file:/home/bsloane/Documents/incubator-daffodil/test/test/b.dfdl.xsd
> [error] Schema Definition Error: Type UnsignedShort cannot have 
> lengthKind='implicit' when representation='text'
> Schema context: element reference tns:a Location line 1 in 
> file:/home/bsloane/Documents/incubator-daffodil/test/test/b.dfdl.xsd
> {quote}
> in c.dfdl.xsd, the document is useing representation='binary', and fails with 
> an unhandled exception:
> {quote}!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
>    An unexpected exception occurred. This is a bug!   
> !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
>  Please report this bug and help us fix it:
>   https://daffodil.apache.org/community/#issue-tracker
>  Please include the following exception, the command you ran, and any input, 
> schema, or tdml files used that led to this bug.
> java.util.NoSuchElementException: None.get at 
> scala.None$.get(Option.scala:349) at scala.None$.get(Option.scala:347) at 
> org.apache.daffodil.grammar.primitives.TypeValueCalc.repTypeUnparser$lzycompute(PrimitivesExpressions.scala:264)
>  at 
> org.apache.daffodil.grammar.primitives.TypeValueCalc.repTypeUnparser(PrimitivesExpressions.scala:264)
>  at 
> org.apache.daffodil.grammar.primitives.TypeValueCalc.unparser$lzycompute(PrimitivesExpressions.scala:276)
>  at 
> org.apache.daffodil.grammar.primitives.TypeValueCalc.unparser(PrimitivesExpressions.scala:272)
>  at org.apache.daffodil.grammar.Gram.maybeUnparser(GrammarTerm.scala:146) at 
> org.apache.daffodil.grammar.primitives.ElementCombinatorBase.eRepTypeUnparser$lzycompute(ElementCombinator.scala:421)
>  at 
> org.apache.daffodil.grammar.primitives.ElementCombinatorBase.eRepTypeUnparser(ElementCombinator.scala:421)
>  at 
> org.apache.daffodil.grammar.primitives.ElementParseAndUnspecifiedLength.unparser$lzycompute(ElementCombinator.scala:332)
>  at 
> org.apache.daffodil.grammar.primitives.ElementParseAndUnspecifiedLength.unparser(ElementCombinator.scala:327)
>  at 
> org.apache.daffodil.grammar.primitives.ElementCombinator.unparser$lzycompute(ElementCombinator.scala:143)
>  at 
> org.apache.daffodil.grammar.primitives.ElementCombinator.unparser(ElementCombinator.scala:119)
>  at org.apache.daffodil.grammar.Prod.unparser$lzycompute(Production.scala:92) 
> at org.apache.daffodil.grammar.Prod.unparser(Production.scala:84) at 
> org.apache.daffodil.grammar.Prod.unparser$lzycompute(Production.scala:92) at 
> org.apache.daffodil.grammar.Prod.unparser(Production.scala:84) at 
> org.apache.daffodil.compiler.ProcessorFactory.$anonfun$unparser$1(Compiler.scala:106)
>  at 
> org.apache.daffodil.oolag.OOLAG$OOLAGValueBase.liftedTree1$1(OOLAG.scala:549) 
> at 
> org.apache.daffodil.oolag.OOLAG$OOLAGValueBase.valueAsAny$lzycompute(OOLAG.scala:547)
>  at 
> org.apache.daffodil.oolag.OOLAG$OOLAGValueBase.valueAsAny(OOLAG.scala:544) at 
> org.apache.daffodil.oolag.OOLAG$OOLAGValue.value$lzycompute(OOLAG.scala:594) 
> at org.apache.daffodil.oolag.OOLAG$OOLAGValue.value(OOLAG.scala:594) at 
> org.apache.daffodil.compiler.ProcessorFactory.unparser$lzycompute(Compiler.scala:105)
>  at 
> org.apache.daffodil.compiler.ProcessorFactory.unparser(Compiler.scala:105) at 
> org.apache.daffodil.compiler.ProcessorFactory.$anonfun$new$4(Compiler.scala:127)
>  at 
> org.apache.daffodil.oolag.OOLAG$OOLAGValueBase.liftedTree1$1(OOLAG.scala:549) 
> at 
> org.apache.daffodil.oolag.OOLAG$OOLAGValueBase.valueAsAny$lzycompute(OOLAG.scala:547)
>  at 
> org.apache.daffodil.oolag.OOLAG$OOLAGValueBase.valueAsAny(OOLAG.scala:544) at 
> org.apache.daffodil.oolag.OOLAG$OOLAGHost.$anonfun$checkErrors$2(OOLAG.scala:286)
>  at scala.runtime.java8.JFunction0$mcV$sp.apply(JFunction0$mcV$sp.java:12) at 
> org.apache.daffodil.oolag.OOLAG$.keepGoing(OOLAG.scala:60) at 
> org.apache.daffodil.oolag.OOLAG$OOLAGHost.checkErrors(OOLAG.scala:286) at 
> org.apache.daffodil.oolag.OOLAG$OOLAGHost.checkErrors$(OOLAG.scala:277) at 
> org.apache.daffodil.dsom.SchemaComponentImpl.checkErrors(SchemaComponent.scala:38)
>  at org.apache.daffodil.oolag.OOLAG$OOLAGHost.isError(OOLAG.scala:345) at 
> org.apache.daffodil.oolag.OOLAG$OOLAGHost.isError$(OOLAG.scala:344) at 
> org.apache.daffodil.compiler.ProcessorFactory.super$isError(Compiler.scala:141)
>  at 
> org.apache.daffodil.compiler.ProcessorFactory.$anonfun$isError$3(Compiler.scala:141)
>  at scala.runtime.java8.JFunction0$mcZ$sp.apply(JFunction0$mcZ$sp.java:12) at 
> org.apache.daffodil.oolag.OOLAG$.keepGoing(OOLAG.scala:60) at 
> org.apache.daffodil.compiler.ProcessorFactory.$anonfun$isError$1(Compiler.scala:132)
>  at scala.runtime.java8.JFunction0$mcZ$sp.apply(JFunction0$mcZ$sp.java:12) at 
> scala.util.DynamicVariable.withValue(DynamicVariable.scala:58) at 
> org.apache.daffodil.ExecutionMode$.$anonfun$usingCompilerMode$1(ExecutionMode.scala:64)
>  at org.apache.daffodil.compiler.ProcessorFactory.isError(Compiler.scala:132) 
> at org.apache.daffodil.compiler.Compiler.compileSource(Compiler.scala:359) at 
> org.apache.daffodil.Main$.$anonfun$createProcessorFromSchema$1(Main.scala:704)
>  at org.apache.daffodil.util.Timer$.getTimeResult(Timer.scala:76) at 
> org.apache.daffodil.util.Timer$.getResult(Timer.scala:35) at 
> org.apache.daffodil.Main$.createProcessorFromSchema(Main.scala:703) at 
> org.apache.daffodil.Main$.run(Main.scala:816) at 
> org.apache.daffodil.Main$.main(Main.scala:1351) at 
> org.apache.daffodil.Main.main(Main.scala)
> {quote}



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to