git.net

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[jira] [Commented] (DAFFODIL-1025) InputValueCalc should not cause a circular reference or refer to its element


    [ https://issues.apache.org/jira/browse/DAFFODIL-1025?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16495300#comment-16495300 ] 

Steve Lawrence commented on DAFFODIL-1025:
------------------------------------------

A likely related error occurs with dfdl:occursCountKind. A user reported a test with the following:
{code}
<xs:element ref="Point" minOccurs="0" maxOccurs="unbounded" dfdl:occursCountKind="expression" dfdl:occursCount="{./number-of-points}" />
{code}
The dfdl:occursCount expression incorrectly uses ./ instead of ../, which results in the following exception:
{code}
edu.illinois.ncsa.daffodil.exceptions.Abort: Invariant broken: RelativePathExpression.this.steps2.apply(0).isInstanceOf[edu.illinois.ncsa.daffodil.dpath.Up]
edu.illinois.ncsa.daffodil.exceptions.Assert$.abort(Assert.scala:146)
edu.illinois.ncsa.daffodil.dpath.RelativePathExpression.adjustedSteps$lzycompute(Expression.scala:776)
edu.illinois.ncsa.daffodil.dpath.RelativePathExpression.adjustedSteps(Expression.scala:769)
edu.illinois.ncsa.daffodil.dpath.RelativePathExpression.compiledDPath$lzycompute(Expression.scala:783)
        at edu.illinois.ncsa.daffodil.exceptions.Assert$.abort(Assert.scala:146)
        at edu.illinois.ncsa.daffodil.dpath.RelativePathExpression.adjustedSteps$lzycompute(Expression.scala:776)
        at edu.illinois.ncsa.daffodil.dpath.RelativePathExpression.adjustedSteps(Expression.scala:769)
        at edu.illinois.ncsa.daffodil.dpath.RelativePathExpression.compiledDPath$lzycompute(Expression.scala:783)
        at edu.illinois.ncsa.daffodil.dpath.RelativePathExpression.compiledDPath(Expression.scala:782)
        at edu.illinois.ncsa.daffodil.dpath.WholeExpression.compiledDPath$lzycompute(Expression.scala:607)
        at edu.illinois.ncsa.daffodil.dpath.WholeExpression.compiledDPath(Expression.scala:607)
        at edu.illinois.ncsa.daffodil.dpath.Expression$$anonfun$compiledDPath_$1.apply(Expression.scala:138)
        at edu.illinois.ncsa.daffodil.dpath.Expression$$anonfun$compiledDPath_$1.apply(Expression.scala:138)
  ...
{code}

So it is not only inputValueCalc that cannot refer to itself in a relative expression.

> InputValueCalc should not cause a circular reference or refer to its element
> ----------------------------------------------------------------------------
>
>                 Key: DAFFODIL-1025
>                 URL: https://issues.apache.org/jira/browse/DAFFODIL-1025
>             Project: Daffodil
>          Issue Type: Bug
>          Components: Diagnostics, Front End
>    Affects Versions: s15
>            Reporter: Elizabeth Fahl
>            Priority: Major
>             Fix For: deferred
>
>
> Per requirements, inputValueCalc should not refer to the element the property is on or cause a circular reference to the element. Tests for these conditions parse without problems but errors are expected. 
> See tests in:
> daffodil-test/src/test/scala-debug/edu/illinois/ncsa/daffodil/section17/calc_value_properties/TestInputValueCalcDebug.scala
> daffodil-test/src/test/resources/edu/illinois/ncsa/daffodil/section17/calc_value_properties/inputValueCalc.tdml
> Tests: 
> ngf-dfdl-2776:InputValueCalc-test_InputValueCalc_circular_ref
> ngf-dfdl-2775:InputValueCalc-test_InputValueCalc_refers_self



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)