Skip to content
Snippets Groups Projects
Commit 7726d8db authored by Robert Schubert's avatar Robert Schubert
Browse files

added a check if a shape object was already processed it will not be processed...

added a check if a shape object was already processed it will not be processed again in the recursion.
parent c8648823
No related branches found
No related tags found
No related merge requests found
Pipeline #45883 passed
......@@ -69,17 +69,19 @@ public class ConversionService {
}
int depth = 0;
visitedShapes.put(shape, depth);
for (ShapeProperties property : shape.getConstraints()) {
String children = property.getChildren();
if (children != null) {
VicShape childShape = getShapeByName(children, shapes);
if (childShape != null) {
depth = Math.max(depth, 1 + calculateDepth(childShape, shapes, visitedShapes));
visitedShapes.put(shape, Math.max(depth, visitedShapes.get(shape)));
}
}
}
visitedShapes.put(shape, depth);
return depth;
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment