Bug 298976

Summary: ArrayIndexOutOfBoundsException during deactivationFigure() of PolylineConnection with PolygonDecoration
Product: [Tools] GEF Reporter: Dan <dannytn>
Component: GEF-Legacy Draw2dAssignee: gef-inbox <gef-inbox>
Status: NEW --- QA Contact:
Severity: major    
Priority: P3 CC: nyssen
Version: 3.4   
Target Milestone: ---   
Hardware: PC   
OS: Windows XP   
Whiteboard:

Description Dan CLA 2010-01-06 13:39:12 EST
I have no problem calling deactivationFigure() in AbstractConnectionEditPart if my figure (PolylineConnection) doesn't have a decoration.

As soon as I add a "decoration" to my figure,
PolygonDecoration sourceDecoration = new PolygonDecoration();
((PolylineConnection) connectionFigure).setSourceDecoration(sourceDecoration);

deactivationFigure() gets ArrayIndexOutOfBoundsException.

Here is the stack trace.

java.lang.ArrayIndexOutOfBoundsException: -1
	at java.util.ArrayList.remove(Unknown Source)
	at org.eclipse.draw2d.graph.ShortestPathRouter.internalRemoveObstacle(ShortestPathRouter.java:379)
	at org.eclipse.draw2d.graph.ShortestPathRouter.removeObstacle(ShortestPathRouter.java:594)
	at org.eclipse.draw2d.ShortestPathConnectionRouter.removeChild(ShortestPathConnectionRouter.java:238)
	at org.eclipse.draw2d.ShortestPathConnectionRouter.unhookAll(ShortestPathConnectionRouter.java:114)
	at org.eclipse.draw2d.ShortestPathConnectionRouter.remove(ShortestPathConnectionRouter.java:226)
	at org.eclipse.draw2d.PolylineConnection.setConnectionRouter(PolylineConnection.java:229)
	at org.eclipse.draw2d.ConnectionLayer.remove(ConnectionLayer.java:75)
	at org.eclipse.gef.editparts.AbstractConnectionEditPart.deactivateFigure(AbstractConnectionEditPart.java:122)
Comment 1 Alexander Nyßen CLA 2010-11-21 15:46:26 EST
Looking at the stack trace this seems to be something related to ShortestPathConnection router. However, I fear that from the provided information alone, this will not be reproducible. Could you provide a code snippet that could help to reproduce the problem?