Project

Profile

Help

SequenceType constants removed in Saxon 9.8.0-2

Added by Denis Sukhoroslov over 7 years ago

Hi,

In the latest Saxon HE version a number of SequenceType public constants were removed (SINGLE_ANY_URI, SINGLE_INT, etc). Just wondering, what was the reason for that? The removed constants are used in extension function definitions.

Thanks, Denis.


Replies (2)

RE: SequenceType constants removed in Saxon 9.8.0-2 - Added by Michael Kay over 7 years ago

I think this was a consequence of the changes made in response to bug

https://saxonica.plan.io/issues/3287

We changed the way the constants were defined to try to eliminate the bottleneck identified by that user, and in the course of this we invoked a semi-automatic refactoring that removed the unused constants (unused within the product, that is).

The static initialisation of this class has caused problems in the past with deadlocks during class loading; it also often shows up on performance/memory profiles as a significant part of the initialization overhead. With the new mechanism of BuiltInAtomicType objects holding references to their corresponding SequenceTypes, I would really prefer to allocate all the SequenceType objects lazily on first reference.

I would suggest changing your extension functions so that instead of SequenceType.SINGLE_INT, they use BuiltInAtomicType.INT.one().

Sorry about the incompatibility. We have far too many interfaces like this that are "semi-public" - primarily intended for internal use but sufficiently useful to users that applications are likely to become dependent on them, and to break when we change them. Use s9api interfaces where you can, as we try very hard to keep these compatible.

RE: SequenceType constants removed in Saxon 9.8.0-2 - Added by Denis Sukhoroslov over 7 years ago

Thank you for the explanation, it makes sense. Ok, will use BuiltInAtomicType methods instead.

    (1-2/2)

    Please register to reply