Project

Profile

Help

Bug #5625

closed

DoubleValue cannot be cast to class net.sf.saxon.value.BigDecimalValue with Saxon PE

Added by Octavian Nadolu over 2 years ago. Updated almost 2 years ago.

Status:
Closed
Priority:
Low
Assignee:
Category:
Internals
Sprint/Milestone:
-
Start date:
2022-07-29
Due date:
% Done:

0%

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

Description

If I transform the following XML with the XSL, with Saxon PE 11.3, I get an error: "DoubleValue cannot be cast to class net.sf.saxon.value.BigDecimalValue"

With Saxon EE 11.3 works fine.

<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="2.0">
    <xsl:template match="root">
        <xsl:if test="number(@level) = (1 to 7)"> test </xsl:if>
    </xsl:template>
</xsl:stylesheet>
<root level="3"></root>
Actions #1

Updated by Michael Kay over 2 years ago

Reproduced (in PE 11.3, which I happened to have handy).

Confirmed that it doesn't happen in EE, even with -opt:0.

That probably means I'm going to have to build an IntelliJ project over the PE preprocessed source code for debugging, which I haven't done for a while (not since we switched to gradle).

Actions #2

Updated by Michael Kay over 2 years ago

I built a project using the PEJ preprocessed sources, and the test case runs fine.

This one could be tricky...

Actions #3

Updated by Michael Kay over 2 years ago

The problem appears to occur in 11.3 but not in 11.4. But I haven't tracked down a specific bug fix that clears it.

Actions #4

Updated by Michael Kay over 2 years ago

I think the bug probably went away as a side-effect of fixing bug #5483. But I suspect that merely takes this test case down a different code path: I'm not convinced it fixes the faulty code that caused this exception. There could be other test cases that still trigger it.

Actions #5

Updated by Michael Kay over 2 years ago

  • Category set to Internals
  • Status changed from New to Resolved
  • Assignee set to Michael Kay
  • Applies to branch 11, trunk added
  • Fix Committed on Branch 11, trunk added
  • Platforms Java added

The failing code is in RangeIterator.compareEq(). I strongly suspect that after the fix to #5483, this code is unreachable. However, I'm going to fix it anyway so that it handles a DoubleValue or FloatValue correctly. On the 12.x branch I will do some experiments to see if the code can be removed,

Actions #6

Updated by O'Neil Delpratt almost 2 years ago

  • Fixed in Maintenance Release 12.0 added

Bug issue fix applied in the Saxon 12.0 Major Release. Leaving this bug marked as Resolved until fix applied on the Saxon 11 branch.

Actions #7

Updated by O'Neil Delpratt almost 2 years ago

  • Fixed in Maintenance Release 11.5 added

Bug applied in the Saxon 11.5 Maintenance release.

Actions #8

Updated by O'Neil Delpratt almost 2 years ago

  • Status changed from Resolved to Closed

Please register to edit this issue

Also available in: Atom PDF