This Bugzilla instance is deprecated, and most Eclipse projects now use GitHub or Eclipse GitLab. Please see the deprecation plan for details.
Bug 433053 - ModelAssembler#topoSort() should handle cycles
Summary: ModelAssembler#topoSort() should handle cycles
Status: VERIFIED FIXED
Alias: None
Product: Platform
Classification: Eclipse Project
Component: UI (show other bugs)
Version: 4.2   Edit
Hardware: PC Mac OS X
: P3 normal (vote)
Target Milestone: 4.4 M7   Edit
Assignee: Brian de Alwis CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-04-17 16:55 EDT by Brian de Alwis CLA
Modified: 2014-04-29 11:42 EDT (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Brian de Alwis CLA 2014-04-17 16:55:03 EDT
Cycles can happen between bundles thanks to fragments (A depends on B, but fragment C hosted on B may refer to A).

#topoSort() should be modified to support possible cycles.  And it should be extracted to a utility class.
Comment 1 Brian de Alwis CLA 2014-04-18 16:11:18 EDT
Fixed the topological sort to handle cycles, and eextracted the implementation into a standalone class, with test cases.  Committed as

https://git.eclipse.org/c/platform/eclipse.platform.ui.git/commit/?id=7cf94f1de53cc9583684ffd4a91fb26c0be3d19e
Comment 2 Brian de Alwis CLA 2014-04-29 11:42:23 EDT
We don't have any bundles with cycles, but the tests run fine on I20140428-2000 and verified that the following situation is handled:

    bundleA depends on bundle B
    bundleB hosts fragmentC
    fragmentC depends on bundleA

so that bundleB has a dependency on bundleA.