Project

Profile

Help

Bug #3194

closed

NPE: Internal error: expression . has no retained static context

Added by Gunther Rademacher about 7 years ago. Updated almost 7 years ago.

Status:
Closed
Priority:
Normal
Assignee:
-
Category:
-
Sprint/Milestone:
-
Start date:
2017-04-05
Due date:
% Done:

100%

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

Description

For tracing operation of a REx parser, I am using a function like this:

declare function local:trace($line as xs:string) as xs:string?
{
  if (trace($line, "trace")) then () else ""[.]
};
java.lang.NullPointerException: Internal error: expression . has no retained static context
        at net.sf.saxon.expr.Expression.getConfiguration(Expression.java:1107)
        at net.sf.saxon.functions.BooleanFn.rewriteEffectiveBooleanValue(BooleanFn.java:53)
        at net.sf.saxon.functions.BooleanFn$1.optimize(BooleanFn.java:106)
        at net.sf.saxon.expr.FilterExpression.optimize(FilterExpression.java:335)
        at net.sf.saxon.expr.Operand.optimize(Operand.java:200)
        at net.sf.saxon.expr.instruct.Choose.optimize(Choose.java:475)
        at net.sf.saxon.query.XQueryExpression.<init>(XQueryExpression.java:85)
        at net.sf.saxon.Configuration.makeXQueryExpression(Configuration.java:3378)
        at net.sf.saxon.query.XQueryParser.makeXQueryExpression(XQueryParser.java:175)
        at net.sf.saxon.query.StaticQueryContext.compileQuery(StaticQueryContext.java:589)
        at net.sf.saxon.query.StaticQueryContext.compileQuery(StaticQueryContext.java:652)
        at net.sf.saxon.s9api.XQueryCompiler.compile(XQueryCompiler.java:606)
        at net.sf.saxon.Query.compileQuery(Query.java:795)
        at net.sf.saxon.Query.doQuery(Query.java:343)
        at net.sf.saxon.Query.main(Query.java:111)
Fatal error during query: java.lang.NullPointerException: Internal error: expression . has no retained static context
declare function local:trace($line as xs:string) as xs:string?
{
  if (trace($line, "trace")) then () else ""[.]
};
 
local:trace("bla bla")
Actions #1

Updated by O'Neil Delpratt about 7 years ago

Thank for sending the bug repo. This is a bug, which seems to be related to the bug issue #3177. Investigating the problem.

Actions #2

Updated by O'Neil Delpratt about 7 years ago

  • Status changed from New to Resolved
  • Fix Committed on Branch 9.7, 9.8 added

The issue here is the ""[.] is rewritten as a boolean system function 'boolean(.)' which has failed to set the RetainedStaticContext.

Made change to the makeCall method in the SystemFunction class to add the RetainedStaticContext for safety.

Bug fixed and committed to subversion.

Actions #3

Updated by O'Neil Delpratt almost 7 years ago

  • Fix Committed on Branch trunk added
  • Fix Committed on Branch deleted (9.8)
Actions #4

Updated by O'Neil Delpratt almost 7 years ago

  • Status changed from Resolved to Closed
  • % Done changed from 0 to 100
  • Fixed in Maintenance Release 9.7.0.19 added

Bug fix applied in the 9.7.0.19 maintenance release.

Please register to edit this issue

Also available in: Atom PDF