|EObjectValidator.validate() is called multiple times for models that are based on several packages [message #1117290]
||Thu, 26 September 2013 09:26
| Maarten Bezemer
Registered: February 2012
I am using models that are based on multiple ecore packages.
For each package I have multiple (combined) EVL validation rules registered.
The combined EVL rules start off with the default EObjectValidator.
Since I have multiple ecore packages, not all rules are combined since they are registered to their corresponding package. (Which is a good thing!)
I manually find the used packages, and invoke the validation rules of each of these packages.
This results in the EObjectValidator rules getting activated multiple times. This is a waste of time and this result in errors on circular contained objects (because EObjectValidator does not expect to be called multiple times with the same context).
EObjectValidator sets ROOT_OBJECT to detect these circular containment problems.
When CompositeEValidator#validate(EClass, EObject, DiagnosticChain, Map<Object, Object>) gets modifies to check for this context entry just before the EObjectValidator gets invoked, so it can be skipped, the problem is solved.
Is this an acceptable solution and should I open a bug report and provide such a patch? Or is this too much of a 'hack'?
Powered by FUDForum
. Page generated in 0.06066 seconds