gef
gef copied to clipboard
IllegalArgumentException during connection.removeAllControlPoints();
If you call org.eclipse.gef.fx.nodes.Connection.removeAllControlPoints() in a certain situation an IllegalArgumentException is thrown.
Caused by: java.lang.IllegalArgumentException: Index out of range (index: 1, size: 1).
at org.eclipse.gef.fx.nodes.Connection.removeControlPoint(Connection.java:1499)
at org.eclipse.gef.fx.nodes.Connection.removeAllControlPoints(Connection.java:1391)
at com.initka.nui.gef.core.development.RouterExample.initConnection(RouterExample.java:71)
We are using version 5.0.1
Thank you for reporting the issue!
I could easily reproduce the error using your example => Creating a test and debugging the issue right now.
First insight: the reason seems to be that removeControlPoint(index) might lead to more than the given control point being removed due to routing.
Possible solution: keep track of anchorsByKeys.size. Maybe I can find a nicer solution though.