-
1. Re: Strange behavior going from 7.3 to 7.6
rareddy Jan 30, 2012 11:37 AM (in response to zkon)zkon,
Which translator shows the above behaviour?
Ramesh..
-
2. Re: Strange behavior going from 7.3 to 7.6
shawkins Jan 30, 2012 2:43 PM (in response to zkon)zkon,
The CollectorVisitor was changed to be a subclass of HierarchyVisitor. This wasn't considered a breaking change though as the results from the static CollectorVisitor methods should not be different. In 7.3 the CollectorVisitor is not intended for use without a DelegatingHierarchyVisitor. The various behaviors can be summarized as:
7.3 CollectorVisitor.acceptVisitor(...) - collects only the top level object if it matches. This is really just an instanceof check.
7.3 using a DelegatingHierarchy visitor or the CollectorVisitor.collectObjects(Class, LanguageObject) static method - returns all AndOr instances, which in your example would be 3 - the top level and the 2 children.
7.6 CollectorVisitor.acceptVisitor(...) - collects only the matching children of the top level object, which is what you show above with the 2 results.
7.6 CollectorVisitor.collectObjects(Class, LanguageObject) static method - same as 7.3, returns all 3 instances.
I hope this makes more sense. We can update the javadoc to clarify the usage if needed.
Thanks,
Steve
-
3. Re: Strange behavior going from 7.3 to 7.6
zkon Jan 30, 2012 2:39 PM (in response to shawkins)Thanks Steve, that looks just like whats happening and I'll change my translator accordingly.
Kon