Project

Profile

Help

Bug #4614

closed

Crash in string-to-double conversion

Added by Michael Kay almost 4 years ago. Updated over 3 years ago.

Status:
Closed
Priority:
Normal
Assignee:
Category:
Saxon extensions
Sprint/Milestone:
-
Start date:
2020-06-26
Due date:
% Done:

100%

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

Description

Encountered while converting some xslt3extra tests to qt3extra. Test case highest-003 does

saxon:highest(doc('highest/highest-003.xml')/*/*)

and selects an element whose string value is non-numeric ("cat"), this results in a stack trace

-s:saxon-highest -t:highest-004
java.lang.NumberFormatException: For input string: "cat"
	at sun.misc.FloatingDecimal.readJavaFormatString(FloatingDecimal.java:2043)
	at sun.misc.FloatingDecimal.parseDouble(FloatingDecimal.java:110)
	at java.lang.Double.parseDouble(Double.java:538)
	at net.sf.saxon.type.StringToDouble.stringToNumber(StringToDouble.java:168)
	at com.saxonica.functions.extfn.HighestOrLowest.call(HighestOrLowest.java:87)

The test is flawed, because the spec says that untypedAtomic values are compared after casting to xs:double (as with fn:min and fn:max); but it shouldn't crash.

Please register to edit this issue

Also available in: Atom PDF