Learn how easy it is to sync an existing GitHub or Google Code repo to a SourceForge project! See Demo

Close

#330 ClassCastException comparing derived numeric value

v8.3
closed
Michael Kay
5
2012-10-08
2005-03-18
Michael Kay
No

A ClassCastException may occur when evaluating a
comparison such as ($x < 5) when $x is a number
belonging to a user-defined derived numeric type, for
example a type derived by restriction from xs:integer.

Affects the schema-aware product only. Reported in
Saxon-SA 8.3 but probably affects earlier releases also.

Source fix: in net.sf.saxon.expr.MinimaxComparison,
method getRange (line 126), change the start of the
method from

        NumericValue val = (NumericValue)iter.next();
        if (val == null) break;

to

        AtomicValue av = (AtomicValue)iter.next();
        if (av == null) break;
        NumericValue val =

(NumericValue)av.getPrimitiveValue();

Michael Kay

Discussion