Bug 377699 - AutomaticRouter does not correctly handle remove
Summary: AutomaticRouter does not correctly handle remove
Status: NEW
Alias: None
Product: GEF
Classification: Tools
Component: GEF-Legacy Draw2d (show other bugs)
Version: unspecified   Edit
Hardware: PC Windows 7
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: gef-inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-04-25 16:44 EDT by Matthias F CLA
Modified: 2013-01-05 06:43 EST (History)
0 users

See Also:


Attachments
Fixed loop start value (2.36 KB, patch)
2013-01-05 06:43 EST, Willem Duminy CLA
willem.duminy: review?
Details | Diff

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