Actions
Bug #2203
closedNPE in XsltExecutable with 9.6.0-1
Start date:
2014-10-29
Due date:
% Done:
0%
Estimated time:
Legacy ID:
Applies to branch:
Fix Committed on Branch:
Fixed in Maintenance Release:
Platforms:
Description
The globals
variable in the code below (from net.sf.saxon.s9api.XsltExecutable@) is used without checking for @null
first.
public HashMap<QName, ParameterDetails> getGlobalParameters() {
List<GlobalVariable> globals = preparedStylesheet.getCompiledGlobalVariables();
HashMap<QName, ParameterDetails> params = new HashMap<QName, ParameterDetails>(globals.size());
for (GlobalVariable v : globals) {
if (v instanceof GlobalParam) {
ParameterDetails details = new ParameterDetails(v.getRequiredType(), v.isRequiredParam());
params.put(new QName(v.getVariableQName()), details);
}
}
return params;
}
This is the relevant part of the stacktrace:
java.lang.NullPointerException: null
at net.sf.saxon.s9api.XsltExecutable.getGlobalParameters(XsltExecutable.java:126)
at net.sf.saxon.jaxp.TransformerImpl.setParameter(TransformerImpl.java:196)
The documentation of Executable.getCompiledGlobalVariables()
says that it may return @null@.
This is a showstopper bug for us so we need to revert to 9.5 until this is addressed.
Related issues
Updated by Michael Kay about 10 years ago
Thanks for reporting it. It's a duplicate; a workaround is to declare a dummy stylesheet parameter. We're hoping to get a maintenance release out very soon (but we're also hoping to squeeze as many fixes into it as we can).
Updated by Michael Kay about 10 years ago
- Status changed from New to Duplicate
- Assignee set to Michael Kay
- Priority changed from High to Normal
- Found in version changed from 9.6.0-1 to 9.6
Updated by Jörn Huxhorn about 10 years ago
Whoops, I guess I only searched the open issues while checking if it was already reported.
Please register to edit this issue
Actions