Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 370933

Summary: SpecializationTypeRegistry::getMatchingAdvice() returned advice list order
Product: [Modeling] GMF-Runtime Reporter: Yann Tanguy <yann.tanguy>
Component: GeneralAssignee: Project Inbox <gmf-runtime-inbox>
Status: NEW --- QA Contact:
Severity: normal    
Priority: P3 CC: eclipse-bugzilla
Version: 1.4.0   
Target Milestone: ---   
Hardware: PC   
OS: Windows 7   
Whiteboard:
Attachments:
Description Flags
Proposed patch none

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).