Skip to content

Commit

Permalink
Fix javadoc, add translation context
Browse files Browse the repository at this point in the history
  • Loading branch information
gabortim committed Dec 20, 2023
1 parent eb04f30 commit db741d5
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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()
Expand All @@ -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<WaySegment> createSegments(Map<Node, List<Node>> graphMap, Collection<Node> nodes) {
Expand Down Expand Up @@ -147,6 +149,7 @@ private static Collection<WaySegment> createSegments(Map<Node, List<Node>> 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<br>{@code -1} if node not part of the way
Expand Down

0 comments on commit db741d5

Please sign in to comment.