Fine with me. Seems to be the way it works in the past, so we should not
change it!
-- Michael
Marshall Schor wrote:
Given that (as far as I can tell - let's see, that would be AFAICT),
the resultSpec is *always* used in compiled mode (because the wrapper
always compiles it), the current implementation would have the effect
that
1) the allFeatures flag would work
2) subtypes of a type specified in the resultSpec would also be
implicitly in the resultSpec
Therefore, to keep the implementation behavior constant (a good thing
to try for, always :-) ) we should insure any changes continue to
exhibit this behavior, and update the Javadocs and documentation to
reflect this.
Other opinions?
-Marshall
Michael Baessler wrote:
Marshall Schor wrote:
In looking thru the code for ResultSpecification_Impl, it seems
there seems to be an inconsistency - unless I (quite possible :-) )
missed something.
The calls to the containsType(...) method operate in one of 2 ways,
depending on whether or not the result specification has been
"compiled" by calling the compile method.
If the result spec has not been compiled, then containsType(...)
returns true iff the type specified is "equal(...)" to a type in the
Result Specification.
If it has been compiled, then the containsType returns true iff the
type specified is equal to a type *or any of its subtypes* in the
Result Specification. This is because compiling a
resultSpecification adds the subtypes.
Can others confirm this? In actual use within annotators, it may be
that the result spec is always compiled before use (I haven't yet
traced that down).
Yes, you are right, when the result spec is compiled all subtypes of
a type are additionally added to the map. The same for features, if
the allAnnotationFeatures is set to true.
Should the code and Javadocs be updated to have containsType return
true for subtypes of types in the result spec, always?
I think both ways should return the same result. But which way is
correct? If I specify a type in the result spec is it correct that
all subtypes are also in?
If I just want to have the sub types in the result spec it is easy to
do, but what if I only want to have the super types in the result
spec without the subtypes?
-- Michael