Project

Profile

Help

Bug #1578

closed

IllegalState exception thrown when function-lookup() retrieves a compile-time function

Added by O'Neil Delpratt over 11 years ago. Updated over 11 years ago.

Status:
Closed
Priority:
Normal
Category:
Internals
Sprint/Milestone:
-
Start date:
2012-07-11
Due date:
% Done:

100%

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

Description

The following query (taken from W3C FOTS:fn-function-lookup-314) causes Saxon to throw an IllegalState exception:

function-lookup(fn:QName('http://www.w3.org/2005/xpath-functions', 'unordered'), 1)(1)

The problem occurs with all "compile-time functions" - those that are normally processed entirely at compile time. Apart from unordered(), other examples include true(), false(), and static-base-uri().

The stack trace of the exception thrown is as follows:

java.lang.IllegalStateException: Function unordered should have been resolved at compile-time
	at net.sf.saxon.functions.CompileTimeFunction.iterate(CompileTimeFunction.java:42)
	at com.saxonica.functions.hof.FirstClassFunction.invoke(FirstClassFunction.java:104)
	at com.saxonica.functions.hof.DynamicFunctionCallDefinition$DynamicFunctionCall.call(DynamicFunctionCallDefinition.java:158)
	at net.sf.saxon.functions.IntegratedFunctionCall.iterate(IntegratedFunctionCall.java:235)
	at net.sf.saxon.query.XQueryExpression.iterator(XQueryExpression.java:341)
	at net.sf.saxon.s9api.XQueryEvaluator.evaluate(XQueryEvaluator.java:378)
	at com.saxonica.testdriver.FOTestSuiteDriver.runTestCase(FOTestSuiteDriver.java:1142)
Actions #1

Updated by O'Neil Delpratt over 11 years ago

  • Category set to Internals
  • Status changed from New to Resolved
  • % Done changed from 0 to 100

Bug fixed. Fix applied to the FunctionLookup class in the lookup method.

Actions #2

Updated by O'Neil Delpratt over 11 years ago

Change committed to svn repository.

Actions #3

Updated by Michael Kay over 11 years ago

Note that the effect of the fix is that function-lookup() treats "compile time functions" as unavailable - that is, it fails cleanly rather than crashing. Compile-time functions are functions that are normally evaluated statically, for example true(), false(), static-base-uri(). In a future release, function-lookup() will be able to locate such functions and return them as function items.

Actions #4

Updated by Michael Kay over 11 years ago

  • Subject changed from IllegalState exception thrown in fn-function-lookup-314 to IllegalState exception thrown when function-lookup() retrieves a compile-time function
  • Description updated (diff)
Actions #5

Updated by O'Neil Delpratt over 11 years ago

  • Status changed from Resolved to Closed
  • Fixed in version set to 9.4.0.6

Please register to edit this issue

Also available in: Atom PDF