Project

Profile

Help

Bug #2203

closed

NPE in XsltExecutable with 9.6.0-1

Added by Jörn Huxhorn over 9 years ago. Updated over 9 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
Actions #1

Updated by Michael Kay over 9 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).

Actions #2

Updated by Michael Kay over 9 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
Actions #3

Updated by Jörn Huxhorn over 9 years ago

Whoops, I guess I only searched the open issues while checking if it was already reported.

Please register to edit this issue

Also available in: Atom PDF