JOSM #21881 - Add a check for loops in directional waterways
See https://josm.openstreetmap.de/ticket/21881
The code is tested and ready to review, only the Tarjan class needs to be moved around because I intended it a generally usable utility class.
Thanks, I forgot to run pmd and checkstyle. It should be fixed now.
What about the folder naming algos? I plan to move "general" algorithms to this folder in the future to have a common place and reduce possible duplications.
As a general rule of thumb, I would avoid shortening names. algos is fairly self-explanatory to native English speakers, but algorithms is probably better.
I fixed all the findings, checkstyle and pmd pass now. Testsuite is running.
One thing remains in my head, if the data.validator is a good place for the new algorithms package. It may be better placed one level up, under data. What do you think?
It depends upon how widespread the algorithm usage could be. I'd probably put it in data.
Done in 53b386d.
In 19062/josm: fix #21881: Add a check for loops in directional waterways Patch by gaben, slightly modified
- implements Tarjan algorithm to find strongly connected components
- new preference
validator.CycleDetector.directionalWaterwayscontains the list of waterway values which should be checked