Bug 377699

Summary: AutomaticRouter does not correctly handle remove
Product: [Tools] GEF Reporter: Matthias F <matthias.flock>
Component: GEF-Legacy Draw2dAssignee: gef-inbox <gef-inbox>
Status: NEW --- QA Contact:
Severity: normal    
Priority: P3    
Version: unspecified   
Target Milestone: ---   
Hardware: PC   
OS: Windows 7   
Whiteboard:
Attachments:
Description Flags
Fixed loop start value willem.duminy: review?

Description Matthias F CLA 2012-04-25 16:44:20 EDT
Build Identifier: Version: Indigo Service Release 2 Build id: 20120216-1857

When using two connections between two objects and deleting the "straight" one, the other one does not get revalidated.

When the other connection is added again, both are drawn bend and overlay each other.

This image should illustrate the issue:
http://imageshack.us/photo/my-images/856/routerb.jpg

The router uses this part to get check the other connections:

int index = connections.remove(connectionKey, conn);
for (int i = index + 1; i < connectionList.size(); i++)
((Connection) connectionList.get(i)).revalidate();

Because i is 1 (because the index is 0) and the size of the list is also 1, the loop is never entered.

When the connection is added again, the router assumes, that the existing one is routed straight and therefor also bends the new connection.

Reproducible: Always

Steps to Reproduce:
1.Use a AutomaticRouter (e.g. FanRouter) for the editor/connection layer
2.add two objects and connect them with two connections
3.delete the straight connection
4.add a new connection between the two objects
Comment 1 Willem Duminy CLA 2013-01-05 06:43:37 EST
Created attachment 225243 [details]
Fixed loop start value

After removing an item from the list, the index of the item that follows the one being removed is equal to the old index of the removed item.