| Summary: | Navigator does not correctly check for createable child objects | ||||||
|---|---|---|---|---|---|---|---|
| Product: | [Modeling] ECP | Reporter: | Mike Haney <txmikester> | ||||
| Component: | Navigator | Assignee: | Franziska Haunolder <franziska.haunolder> | ||||
| Status: | CLOSED FIXED | QA Contact: | |||||
| Severity: | normal | ||||||
| Priority: | P3 | CC: | corrmage, eclipse, jhelming, mkoegel | ||||
| Version: | unspecified | ||||||
| Target Milestone: | 0.8.9 | ||||||
| Hardware: | PC | ||||||
| OS: | Windows 7 | ||||||
| Whiteboard: | |||||||
| Attachments: |
|
||||||
|
Description
Mike Haney
Thanks for this detailed report, this is indeed a bug and must be fixed. Created attachment 202593 [details]
Preliminary patch to fix the bug.
Preliminary patch to fix the bug.
Preliminary fixed the bug with a patch. As far as i can see patch solved problem described in this bug, but it doesn't allow following usecase: abstract InheritedItem with EReference subclasses [1..*] : InheritedItem; Product -> InheritedItem Type -> InheritedItem Reference -> InheritedItem with default generated code one can add Types to Product's subclasses, for example, which is wrong in my domain model. So, I edited collectNewChildDescriptors method of (Product | Type | Reference)ItemProvider to return only corresponding child descriptors. But DynamicContainmentCommands collects new child descriptors only for containment detection. In createCommands method it calls to addCommandForSubTypes, because EReference type is abstract. Maybe addcommandForSubTypes should take child descriptors into account in some way? looks like current implementation has another problem. I'll use domain model from previous comment. In getContributionItems method of DynamicContainmentCommands all child descriptors considered as different containments, event if all of them are child descriptors for one EReference. So, in example domain model it leads to duplication (actually triplication) of creation menu items, because addCommandForSubtypes called for every child descriptor and returns 3 menus for every child descriptor, so we would get 9 menu items. ok |