Project

Profile

Help

Bug #2289

closed

NPE in ContextItemTypeExpression

Added by O'Neil Delpratt about 9 years ago. Updated over 8 years ago.

Status:
Closed
Priority:
Normal
Category:
Internals
Sprint/Milestone:
Start date:
2015-01-16
Due date:
% Done:

100%

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

Description

Bug issue reported by Hans-Juergen Rennau:

XQuery files were sent privately.

There seems to be a bug producing a NPE (version Saxon-HE 9.6.0.3J).

Problem: Trying to launch the query, I get a NPE (see below). You might reproduce the problem by unzipping the directory I send you and launching 'writeOtdsReport.xq':

     xqueryx writeOtdsReport.xq doc=dummy.xml format=txt numOffers=1

The problem is triggered by the second parameter of the library function 'writeOtdsReport' called by the main module: after removing the (not used) second parameter and adapting the call from the main module, no NPE occurs.

The function 'writeOtdsReport' you find in module writeOtdsReport-logical.mod.xq

ava.lang.NullPointerException
    at net.sf.saxon.expr.ContextItemExpression.typeCheck(ContextItemExpression.java:85)
    at net.sf.saxon.expr.parser.ExpressionVisitor.typeCheck(ExpressionVisitor.java:188)
    at net.sf.saxon.expr.FunctionCall.typeCheck(FunctionCall.java:125)
    at net.sf.saxon.expr.parser.ExpressionVisitor.typeCheck(ExpressionVisitor.java:188)
    at net.sf.saxon.expr.LetExpression.typeCheck(LetExpression.java:80)
    at net.sf.saxon.expr.parser.ExpressionVisitor.typeCheck(ExpressionVisitor.java:188)
    at net.sf.saxon.expr.SlashExpression.promoteFocusIndependentSubexpressions(SlashExpression.java:489)
    at net.sf.saxon.expr.SlashExpression.optimize(SlashExpression.java:346)
    at net.sf.saxon.expr.parser.ExpressionVisitor.optimize(ExpressionVisitor.java:244)
    at net.sf.saxon.expr.sort.DocumentSorter.optimize(DocumentSorter.java:75)
    at net.sf.saxon.expr.parser.ExpressionVisitor.optimize(ExpressionVisitor.java:244)
    at net.sf.saxon.expr.CardinalityChecker.optimize(CardinalityChecker.java:123)
    at net.sf.saxon.expr.parser.ExpressionVisitor.optimize(ExpressionVisitor.java:244)
    at net.sf.saxon.expr.FunctionCall.optimize(FunctionCall.java:168)
    at net.sf.saxon.expr.UserFunctionCall.optimize(UserFunctionCall.java:338)
    at net.sf.saxon.expr.parser.ExpressionVisitor.optimize(ExpressionVisitor.java:244)
    at net.sf.saxon.expr.SlashExpression.optimize(SlashExpression.java:300)
    at net.sf.saxon.expr.parser.ExpressionVisitor.optimize(ExpressionVisitor.java:244)
    at net.sf.saxon.expr.sort.DocumentSorter.optimize(DocumentSorter.java:75)
    at net.sf.saxon.expr.parser.ExpressionVisitor.optimize(ExpressionVisitor.java:244)
    at net.sf.saxon.expr.flwor.FLWORExpression$7.processExpression(FLWORExpression.java:488)
    at net.sf.saxon.expr.flwor.LetClause.processSubExpressions(LetClause.java:106)
    at net.sf.saxon.expr.flwor.FLWORExpression.optimize(FLWORExpression.java:486)
    at net.sf.saxon.expr.parser.ExpressionVisitor.optimize(ExpressionVisitor.java:244)
    at net.sf.saxon.query.XQueryFunction.optimize(XQueryFunction.java:471)
    at net.sf.saxon.query.XQueryFunctionLibrary.optimizeGlobalFunctions(XQueryFunctionLibrary.java:289)
    at net.sf.saxon.query.QueryModule.optimizeGlobalFunctions(QueryModule.java:1208)
    at net.sf.saxon.expr.instruct.Executable.fixupQueryModules(Executable.java:597)
    at net.sf.saxon.query.XQueryParser.makeXQueryExpression(XQueryParser.java:159)
    at net.sf.saxon.query.StaticQueryContext.compileQuery(StaticQueryContext.java:570)
    at net.sf.saxon.query.StaticQueryContext.compileQuery(StaticQueryContext.java:633)
    at net.sf.saxon.s9api.XQueryCompiler.compile(XQueryCompiler.java:592)
    at net.sf.saxon.Query.compileQuery(Query.java:787)
    at net.sf.saxon.Query.doQuery(Query.java:340)
    at net.sf.saxon.Query.main(Query.java:111)
Fatal error during query: java.lang.NullPointerException:  (no message)

Please register to edit this issue

Also available in: Atom PDF