From db741d5a76199c0df6befcfa06638195a567da78 Mon Sep 17 00:00:00 2001 From: gaben <23311361+gabortim@users.noreply.github.com> Date: Wed, 20 Dec 2023 14:54:07 +0100 Subject: [PATCH] Fix javadoc, add translation context --- .../josm/data/validation/algorithms/Tarjan.java | 5 +++++ .../josm/data/validation/tests/CycleDetector.java | 7 +++++-- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/src/org/openstreetmap/josm/data/validation/algorithms/Tarjan.java b/src/org/openstreetmap/josm/data/validation/algorithms/Tarjan.java index ecd735c95d2..3dff63fbe1b 100644 --- a/src/org/openstreetmap/josm/data/validation/algorithms/Tarjan.java +++ b/src/org/openstreetmap/josm/data/validation/algorithms/Tarjan.java @@ -43,6 +43,11 @@ public final class Tarjan { /** Used on algorithm runtime to keep track discovery progress. */ private int index; + /** + * Initialize the Tarjan's algorithm. + * + * @param graph graph data in NodeGraph object format + */ public Tarjan(NodeGraph graph) { graphMap = graph.createMap(); diff --git a/src/org/openstreetmap/josm/data/validation/tests/CycleDetector.java b/src/org/openstreetmap/josm/data/validation/tests/CycleDetector.java index eb8f0da0a62..00879597d3f 100644 --- a/src/org/openstreetmap/josm/data/validation/tests/CycleDetector.java +++ b/src/org/openstreetmap/josm/data/validation/tests/CycleDetector.java @@ -2,6 +2,7 @@ package org.openstreetmap.josm.data.validation.tests; import static org.openstreetmap.josm.tools.I18n.tr; +import static org.openstreetmap.josm.tools.I18n.trc; import java.util.ArrayDeque; import java.util.ArrayList; @@ -85,7 +86,7 @@ public void endTest() { if (possibleCycle.size() > 1) { errors.add( TestError.builder(this, Severity.ERROR, CYCLE_DETECTED) - .message(tr("Cycle in directional waterway network")) + .message(trc("graph theory", "Cycle in directional waterway network")) .primitives(possibleCycle) .highlightWaySegments(createSegments(graphMap, possibleCycle)) .build() @@ -106,8 +107,9 @@ public void clear() { /** * Creates WaySegments from Nodes for the error highlight function. + * * @param graphMap the complete graph data - * @param nodes nodes to build the way segments from + * @param nodes nodes to build the way segments from * @return WaySegments from the Nodes */ private static Collection createSegments(Map> graphMap, Collection nodes) { @@ -147,6 +149,7 @@ private static Collection createSegments(Map> graph /** * Returns the way index of a node. Only the first occurrence is considered in case it's a closed way. + * * @param w parent way * @param n the node to look up * @return {@code >=0} if the node is found or
{@code -1} if node not part of the way