Bug 370933 - SpecializationTypeRegistry::getMatchingAdvice() returned advice list order
Summary: SpecializationTypeRegistry::getMatchingAdvice() returned advice list order
Status: NEW
Alias: None
Product: GMF-Runtime
Classification: Modeling
Component: General (show other bugs)
Version: 1.4.0   Edit
Hardware: PC Windows 7
: P3 normal
Target Milestone: ---   Edit
Assignee: Project Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-02-08 06:06 EST by Yann Tanguy CLA
Modified: 2012-02-09 04:34 EST (History)
1 user (show)

See Also:


Attachments
Proposed patch (1.42 KB, text/plain)
2012-02-08 06:06 EST, Yann Tanguy CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Yann Tanguy CLA 2012-02-08 06:06:24 EST
Created attachment 210719 [details]
Proposed patch

Currently SpecializationTypeRegistry#getMatchingAdvice() returns advices ordered by SpecializationType & MetamodelType inheritance (or definition relations).

For a given Specialization or Metamodel supertype the valid advices are added with no guaranteed order. I would have expected (for a ISpecializationType) that the advice directly associated with the SpecializationType declaration would be return before other advices that can possibly be bound to it. The advice directly associated with the SpecializationType would then be used to define "default" command contribution for the type, making possible to modify this default behavior by adding new advicebindings without modifying the advice of the SpecializationType (just assuming that its getBeforeCommand are added before any advice binding).