IDs for validator rules

Florian Schäfer florian at schaeferban.de
Mon Apr 30 13:39:24 UTC 2018


Hello list,

I have a question about validator rules in JOSM, because I want to write several new rules for the wikipedia plugin as
part of my Summer of Code.

As far as I can see the ID of each test should be unique and JOSM core uses the IDs from 1 to 3799 (see [1]). So can I
simply choose a range of IDs at random somewhere above 3800. Or is there a central place where all IDs that are not in
core are collected?

The comment on line [1] is marked with FIXME, because the current situation is not very good. The global uniqueness of
the IDs is not guaranteed. Would it make sense to no longer use integers as IDs for the TestErrors, but instead use the
fully-qualified class name of the Test-class and an integer that only has to be unique inside this one class?
If an integer ID is needed, the class name could be hashed (and maybe truncated) and use the resulting bytes as ID.

Thanks in advance,
Florian


[1]: https://josm.openstreetmap.de/browser/josm/trunk/src/org/openstreetmap/josm/data/validation/OsmValidator.java?rev=1
3672#L104



More information about the josm-dev mailing list