[
https://issues.apache.org/jira/browse/UIMA-5586?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16179208#comment-16179208
]
Marshall Schor commented on UIMA-5586:
--------------------------------------
Thanks. The top-most (main, in the description) bug is due to a change in the
order of deserialization of things in uima v3. To make the deserialization go
better, sofas are deserialized before annotations (which have references to the
sofas) so these references can be set when deserializaing. (in v2, they're set
using a 2 phase approach, setting a temporary id value, followed by a cleanup
at the end.)
Because of this order change, and because setting the sofa string value has a
"side effect" of updating the DocumentAnnotation instance, in v3, this instance
won't exist initially, and the logic then creates one.
The fix turns out to be fairly simple: when creating sofa FSs during
deserialization, and setting the sofa string, skip the update of the
DocumentAnnotation (because it causes problems :-) and because no update is
needed - it will be deserialized with the proper values at some later point in
the deserialization).
Added a test case.
> uv3: DocumentAnnotation subclasses not handled as in UIMAv2 during
> deserialization
> ----------------------------------------------------------------------------------
>
> Key: UIMA-5586
> URL: https://issues.apache.org/jira/browse/UIMA-5586
> Project: UIMA
> Issue Type: Bug
> Components: Core Java Framework
> Affects Versions: 3.0.0SDK-beta
> Reporter: Richard Eckart de Castilho
> Fix For: 3.0.0SDK-beta
>
>
> Consider the case that you have custom subclass of the uima
> `DocumentAnnotation`, let's call it `DocumentMetaData`. Next, we have an XMI
> file which contains an annotation of the `DocumentMetaData` type.
> When loading such an XMI file in UIMAv2, the CAS ends up with a single
> `DocumentMetaData` annotation which is accessible via
> `cas.getDocumentAnnotation()`.
> When loading the same file with UIMAv3, the CAS ends up with both, a
> `DocumentAnnotation` and a `DocumentMetaData` annotation and
> `cas.getDocumentAnnotation()` returns the former.
> The same appears to happen when deserializing a CAS from various binary
> formats.
--
This message was sent by Atlassian JIRA
(v6.4.14#64029)