[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [Newsgroup Home]
[news.eclipse.tools.emf] Re: TraversalStrategy's double visits

Hi, John,

Are you certain that the validator is not actually being invoked twice?  The default recursive strategy takes steps to ensure that, if it is invoked on a collection of objects, it doesn't re-visit elements that are contained in (and thus traversed recursively from) other elements also in the selection set from which it starts.

I can't think of a means by which the default traversal strategy would visit these elements twice.  The containment of your objects is very simple.

If you put a breakpoint in the DefaultTraversalStrategy (I hope that's the name) then you should be able to infer from the call stack the reason for the repeated visit.

HTH,

Christian


On Wed, 2009-09-16 at 19:25 +0000, John J. Franey wrote:
I have a situation where the BatchValidator is visiting some eobjects
twice.  I've been in debugging session for a few hours and am not seeing
what factor would lead to this.

Here is the model serialized as xml:

<?xml version="1.0" encoding="UTF-8"?>
<scr:component
  xmlns:scr="http://www.osgi.org/xmlns/scr/v1.1.0"
  enabled="true" factory="" immediate="false"
  name="Command Provider for Dictionary Service"
  activate=""
  deactivate=""
  modified="">
     <implementation class="jjjjjjjjjj"/>
     <service/>
</scr:component>


This is the order the strategy returns:

component -> implementation -> service -> implementation -> service.

If a single constraint is defined for 'implementation', it run twice. 
Two IStatus are returned indicating the same constraint failure on the
same eobject. They have the same message, as do the two markers that
are consequently created by BatchValidator.

What can I do so these are visited only once?

Thanks,
John