Adam Lally wrote:
> On 10/22/07, Thilo Goetz <[EMAIL PROTECTED]> wrote:
>> Eddie Epstein wrote:
>>> Consider the following code:
>>> AnalysisEngine ae = UIMAFramework.produceAnalysisEngine(specifier);
>>> CAS cas = ae.newCAS();
>>> cas.setDocumentText("some text");
>>> AnnotationFS fs = cas.createAnnotation(cas.getAnnotationType(), 0,
>>> 4);
>>> ae.process(cas);
>>> System.out.println(fs.getCoveredText());
>>>
>>> Preexisting fs in the client must be valid after a process call, no?
>> No. I've been over this with Adam on one of the OASIS calls, too.
>
> I sort of remember discussing this but can't remember ever coming to a
> conclusion.
>
> It seems to me that this code ought to work. To me it makes sense
> that we say that an _annotator_ shouldn't retain references to FS
> across process calls, since the CAS represents a different document
> each time. But I think it's entirely another thing so say that an
> application can't keep references to FS when it calls an AE's process
> method. It doesn't seem very intuitive to me that the object
> reference would be invalidated. In any case I don't think we
> sufficiently warn our users against this, and since it "happens to
> work" they may not be happy if we change it.
>
> If we're going to vote on it, maybe we solicit user opinions too.
>
> -Adam
It doesn't seem intuitive to me that an object reference whose
underlying object may have been serialized, sent over the network
or to C++, modified, serialized again and sent back is guaranteed
to still be valid afterwards. It makes sense that this should
work when all annotators are local. I don't think it makes sense
to guarantee this behavior in general.
The window of opportunity where I could have worked on this is
closing rapidly. Still, it might make sense to come to a conclusion
in this matter in case it comes up again.
--Thilo