Project

Profile

Help

Bug #2021

closed

Various odd issues --- crashing when maps called with empty arguments

Added by David Rudel over 10 years ago. Updated over 10 years ago.

Status:
Closed
Priority:
Normal
Assignee:
Category:
XSLT conformance
Sprint/Milestone:
-
Start date:
2014-03-10
Due date:
% Done:

100%

Estimated time:
Legacy ID:
Applies to branch:
Fix Committed on Branch:
Fixed in Maintenance Release:
Platforms:

Description

The attached XSLT crashes with no error output when run as-is. If the commented line is toggled, it crashes with an "javaNullPointerException" error, which is not very helpful.

Expected behavior is to throw an error indicating that a function item cannot be called with an empty sequence as argument.

NOTE: there are some very strange nuances going beyond the above, and I suspect there are multiple issues here:

  1. In particular, note the declaration statement for variable $c. This is a variable that is not used anywhere, so it should not affect anything. However, somehow the inclusion of this variable statement prevents the interpreter from recognizing the error. If this variable statement is commented out, a useful error is displayed when execution is attempted.

  2. The strange behavior described in point 1 is itself dependent on other nuances that one would not expect to make any difference. In particular, if the "@a" is removed from the declaration of variable $a, this behavior no longer occurs and program crashes no matter what (regardless of whether the $c variable statement exists). Similarly, a version that does not have the $b declaration, and instead uses $a in the for-each will also not show this odd dependence on the existence of this variable.

  3. If the variable declaration for $c references $b instead of $a, it no longer provides the shielding effect mentioned in number 1 and an error is reported in all cases.

  4. Not shown by this template, but in other cases no error or crash occurs at all and the output provided is the set of keys to the map, even if the procedure used to create the map should have yielded an error.


Files

Public_Map_Error.xsl (952 Bytes) Public_Map_Error.xsl David Rudel, 2014-03-10 18:35

Please register to edit this issue

Also available in: Atom PDF