The Saxon-SA join optimizer may "optimize" a filter
expression to use an index lookup that ignores
dependencies of the filter expression on local
variables that can vary from one evaluation to another.
This results in a stack trace starting:
Exception in thread "main" java.lang.AssertionError:
Value of variable is undefined (null)
[This is caused by the variable filterDependencies in
class FilterExpression not being initialized. The fix
is to remove this variable, and replace its only use
with a call on filter.getDependencies(). The variable
is largely historic].