gmantele / vollt

Java libraries implementing the IVOA protocol: ADQL, UWS and TAP
http://cdsportal.u-strasbg.fr/taptuto/
29 stars 28 forks source link

Case sensitivity in LanguageFeature type #146

Open mbtaylor opened 1 year ago

mbtaylor commented 1 year ago

Language Features currently need canonical capitalisation of the feature type in order to be recognised, for instance if I create a feature like this:

new LanguageFeature(""ivo://ivoa.net/std/TAPRegExt#features-adqlgeo", "CIRCLE")

it is recognised by VOLLT as referring to the standard CIRCLE geometry function, but if I do it like this:

new LanguageFeature("ivo://ivoa.net/std/tapregext#features-adqlgeo", "CIRCLE")

it's not.

This isn't strictly speaking a bug, but it goes against the rule from the IVOID 2.0 specification section 2.1:

The Registry references are, as a whole, compared case-insensitively, and must be treated case-insensitively throughout to maintain backwards compatibility with version 1 of this specification. When comparing full IVOIDs, the local part must be split off and compared preserving case, while the registry part must be compared case-insensitively.

I think this could be fixed by just modifying the (already overridden) equals and hashcode methods in adql.parsers.feature.LanguageFeature to work with case-folded values of type.

I'm happy to write a PR on request, but I don't know whether it could cause subtle unwanted effects elsewhere.

mbtaylor commented 1 year ago

I made a PR in case it's helpful #147. But feel free to discard it if there's some reason why this is not a good idea.