-
Notifications
You must be signed in to change notification settings - Fork 12
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Exception processing function chaining arrow operator =>
in Metapath evaluation
#289
Milestone
Comments
aj-stein-nist
added
bug
Something isn't working
java
Pull requests that update Java code
labels
Jan 12, 2024
aj-stein-nist
added a commit
to aj-stein-nist/metaschema-java
that referenced
this issue
Jan 12, 2024
6 tasks
aj-stein-nist
added a commit
to aj-stein-nist/metaschema-java
that referenced
this issue
Jan 23, 2024
The index and offset for BuildCSTVisitor for arrow chain operator context processing was off and therefore exceptions were occuring when handling => function calls during evaluation and therefore function calls were not instantiated the correct way. We also added tests to validate it works now, uncovering another issue in the use of fn:sum casting integers to decimals, to be fixed in a subsequent commmit.
aj-stein-nist
added a commit
to aj-stein-nist/metaschema-java
that referenced
this issue
Jan 23, 2024
The index and offset for BuildCSTVisitor for arrow chain operator context processing was off and therefore exceptions were occuring when handling => function calls during evaluation and therefore function calls were not instantiated the correct way. We also added tests to validate it works now, uncovering another issue in the use of fn:sum casting integers to decimals, to be fixed in a subsequent commmit.
aj-stein-nist
added a commit
to aj-stein-nist/metaschema-java
that referenced
this issue
Jan 23, 2024
The index and offset for BuildCSTVisitor for arrow chain operator context processing was off and therefore exceptions were occuring when handling => function calls during evaluation and therefore function calls were not instantiated the correct way. We also added tests to validate it works now, uncovering another issue in the use of fn:sum casting integers to decimals, to be fixed in a subsequent commmit.
github-merge-queue bot
pushed a commit
that referenced
this issue
Jan 23, 2024
* Make => operator eqname only in ANTLR grammar Per discussion with maintainers, adjust arrowfunctionspecifier to not parse the arrow function chain operator as a eqname or varref or a parenthesizedexpr, but only an eqname to fix parsing complexity. The relevant code to support this in BuildCSTVisitor has still not been implemented per the TODO comment. * Fix BuildCSTVisitor context processing for #289 The index and offset for BuildCSTVisitor for arrow chain operator context processing was off and therefore exceptions were occuring when handling => function calls during evaluation and therefore function calls were not instantiated the correct way. We also added tests to validate it works now, uncovering another issue in the use of fn:sum casting integers to decimals, to be fixed in a subsequent commmit. * Fix fn:sum to detect integers for return type.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Describe the bug
While writing more advanced tests for #267, @david-waltermire and I discovered that evaluating Metapath expressions such as
string(/document-root/document-element/@id)
but the equivalent/document-root/document-element/@id => string()
throws a null pointer exception, while the latter is modern syntax for the former. Code in the branch for further explanation and repro in new tests directly related to this issue to come later.https://github.com/aj-stein-nist/metaschema-java/blob/1bec6492c116b7ae3da4c03d16e09cd879d45985/metaschema-cli/src/test/java/gov/nist/secauto/metaschema/cli/CLITest.java#L100-L112
Initial analysis indicates that FunctioncallContext and ArrowfunctionspecifierContext do not have the same attributes, thus looking the name of the child function fails on this line in the relevant line below. A bug fix is needed.
https://github.com/usnistgov/metaschema-java/blob/develop/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/cst/BuildCSTVisitor.java#L847
Who is the bug affecting?
Developers using the metaschema-java library for processing Metaschema modules and content.
What is affected by this bug?
Compiling and evaluating any Metapath where there will be a arrow operator to chain functions.
When does this occur?
Consistently.
How do we replicate the issue?
{What are the steps to reproduce the behavior?
mvn test
or use Eclipse or another IDE to cause an exception.Expand for full stack frame
Expected behavior (i.e. solution)
The functions chained successfully compile and evaluate with a valid result.
Other Comments
In the interim, developers can work around this by writing to the traditional syntax without the arrow operator, but maintainers agreed this is important to fix.
The text was updated successfully, but these errors were encountered: