gef icon indicating copy to clipboard operation
gef copied to clipboard

IllegalArgumentException during connection.removeAllControlPoints();

Open BenJanus opened this issue 5 years ago • 1 comments

If you call org.eclipse.gef.fx.nodes.Connection.removeAllControlPoints() in a certain situation an IllegalArgumentException is thrown.

RouterExample.java.txt

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

BenJanus avatar Mar 27 '20 13:03 BenJanus

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.

mwienand avatar Mar 27 '20 14:03 mwienand