Bug 298976 - ArrayIndexOutOfBoundsException during deactivationFigure() of PolylineConnection with PolygonDecoration
Summary: ArrayIndexOutOfBoundsException during deactivationFigure() of PolylineConnect...
Status: NEW
Alias: None
Product: GEF
Classification: Tools
Component: GEF-Legacy Draw2d (show other bugs)
Version: 3.4   Edit
Hardware: PC Windows XP
: P3 major (vote)
Target Milestone: ---   Edit
Assignee: gef-inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-01-06 13:39 EST by Dan CLA
Modified: 2010-11-21 15:46 EST (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
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?