Actions
Bug #5183
closedFeatureKey<Class> mechanism in C# doesn't work
Start date:
2021-12-03
Due date:
% Done:
100%
Estimated time:
Legacy ID:
Applies to branch:
11, trunk
Fix Committed on Branch:
trunk
Fixed in Maintenance Release:
Platforms:
.NET, Java
Description
SaxonCS had adopted the same scheme of defining FeatureKey as a generic class parameterised by the type of the property. In Java this means you can do
processor.setProperty(FeatureKey.TIMING, true)
and you get a type error if you try to supply a string rather than a boolean.
On C# this doesn't work.
Firstly, you have to specify the type explicitly:
processor.setProperty(FeatureKey<boolean>.TIMING, true)
which tends to outweigh any convenience factor.
More seriously, it's not possible to do
processor.setProperty(FeatureKey<URIResolver>.URI_RESOLVER, new MyResolver())
if MyResolver
is a subclass of URIResolver
.
I'm therefore proposing to degenerify Feature and FeatureKey, with a loss of type-safety by an improvement in usability.
This is an incompatible change.
Updated by Michael Kay over 2 years ago
- Category set to .NET API
- Status changed from New to Resolved
- Priority changed from Low to Normal
- Applies to branch 11, trunk added
- Fix Committed on Branch trunk added
The change has been made and documented and will affect SaxonCS 11.1.
Updated by O'Neil Delpratt about 2 years ago
- % Done changed from 0 to 100
- Fixed in Maintenance Release 11.1 added
- Platforms .NET, Java added
Bug fix applied in the Saxon 11.1 release.
Updated by O'Neil Delpratt about 2 years ago
- Status changed from Resolved to Closed
Please register to edit this issue
Actions