Project

Profile

Help

Bug #3800

closed

Expected external object of class java.net.URL, got class net.sf.saxon.value.AnyURIValue

Added by Michael Kay almost 6 years ago. Updated almost 6 years ago.

Status:
Closed
Priority:
Normal
Assignee:
Category:
Saxon extensions
Sprint/Milestone:
-
Start date:
2018-05-30
Due date:
% Done:

100%

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

Description

See forum post https://saxonica.plan.io/boards/3/topics/7196

The issue here is that given an external Java call JarURLConnection::getURL() with a declared return type of java.net.URL, the default conversion would turn this into an xs:anyURI value. But because the result is bound to a variable with required type javatype:java.net.URL, the static type checking calls JavaExtensionFunctionCall.adjustRequiredType(), and this changes the conversion applied to the result value. However, adjustRequiredType is not called when the stylesheet is reloaded from a SEF file, and in fact the information required to do this is not present in the SEF file.

Actions #1

Updated by Michael Kay almost 6 years ago

  • Status changed from New to Resolved
  • Applies to branch 9.8, trunk added
  • Fix Committed on Branch 9.8, trunk added

JavaExtensionFunctionCall now exports the static declaredType property. PackageLoaderPE sees this and calls JavaExtensionFunctionCall.adjustRequiredType.

Test case added to xslt30extra.

Actions #2

Updated by Debbie Lockett almost 6 years ago

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

Bug fix applied in the Saxon 9.8.0.14 maintenance release.

Please register to edit this issue

Also available in: Atom PDF