Project

Profile

Help

Bug #2203

closed

NPE in XsltExecutable with 9.6.0-1

Added by Jörn Huxhorn about 10 years ago. Updated about 10 years ago.

Status:
Duplicate
Priority:
Normal
Assignee:
Category:
s9api API
Sprint/Milestone:
-
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

Is duplicate of Saxon - Bug #2178: NullPointerException in TransformerImpl.setParameter()Closed2014-10-13

Actions
Is duplicate of Saxon - Bug #2185: NullPointerException when setting a parameter valueDuplicate2014-10-16

Actions

Please register to edit this issue

Also available in: Atom PDF