Route graph connection rendering/picking/etc crashes with specific connection
Connections that have:
- One or more persistent route lines
- Direct (free-angled) connection line routing at both/all ends of the connection
will crash during rendering and picking of the route line.
The crashes happen because RouteLine.points
will be empty under these circumstances.
Exception in thread "AWT-EventQueue-0" java.lang.IndexOutOfBoundsException: Index 0 out of bounds for length 0
at java.base/jdk.internal.util.Preconditions.outOfBounds(Preconditions.java:64)
at java.base/jdk.internal.util.Preconditions.outOfBoundsCheckIndex(Preconditions.java:70)
at java.base/jdk.internal.util.Preconditions.checkIndex(Preconditions.java:248)
at java.base/java.util.Objects.checkIndex(Objects.java:372)
at java.base/java.util.ArrayList.get(ArrayList.java:459)
at org.simantics.diagram.connection.RouteLine.getBegin(RouteLine.java:161)
at org.simantics.diagram.connection.RouteGraph.getPath2D(RouteGraph.java:1432)
at org.simantics.scenegraph.g2d.nodes.connection.RouteGraphNode.render(RouteGraphNode.java:451)
at org.simantics.scenegraph.g2d.G2DParentNode.render(G2DParentNode.java:117)
at org.simantics.scenegraph.g2d.nodes.TransformNode.render(TransformNode.java:50)
at org.simantics.scenegraph.g2d.nodes.SingleElementNode.render(SingleElementNode.java:170)
at org.simantics.scenegraph.g2d.nodes.spatial.RTreeNode.render(RTreeNode.java:180)
at org.simantics.scenegraph.g2d.G2DParentNode.render(G2DParentNode.java:117)
...
and other exceptions relating to RouteLine.points
being empty will occur.
Reproduction with Apros:
- Create Point -> Pipe
- Mark point's related routing to Direct
claimRelatedValue "the connections other end DIA.Connector" DIA.Connector.straight True
- Try moving the connection around
- The diagram will stop reacting and rendering
In Apros District, all generated diagrams have connections with direct routing for both connections ends. Those are easily broken by simply dragging a bit on the canvas on top of a connection line.
Edited by Tuukka Lehtonen