[
https://issues.apache.org/jira/browse/UIMA-5601?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16190404#comment-16190404
]
Richard Eckart de Castilho commented on UIMA-5601:
--------------------------------------------------
Ok, I guess I have read the proposal in a wrong way. I understood you wanted to
have two cases, one where the user sets the sofa string in the target CAS and
one where the CasCopier sets the sofa string in the target CAS and handle the
document annotation differently in these cases. Nevermind.
Wrt. 1. the CasCopier should copy the sofa only if the target CAS/view doesn't
already has one - I assume that was just not mentioned but implicitly assumed.
Yes, it could be done that way. It might break user code though if that code
relies on the fact that CasCopier presently implicitly creates a
DocumentAnnotation when the sofa is copied. If that is unproblematic, then the
proposal seems to provide a very simple and straightforward API/behavior.
> uv3: CasCopier problems with custom subclasses of DocumentAnnotation
> --------------------------------------------------------------------
>
> Key: UIMA-5601
> URL: https://issues.apache.org/jira/browse/UIMA-5601
> Project: UIMA
> Issue Type: Bug
> Components: Core Java Framework
> Affects Versions: 3.0.0SDK-beta
> Reporter: Richard Eckart de Castilho
>
> It seems as if there may be a bug in the way that CasCopier handles the
> documen annotation.
> Specifically, it seems as if the CasCopier incorrectly handles the case where
> the target CAS already contains a document annotation. In my case, I do:
> * create the target CAS
> * add a document annotation (DocumentMetaData extends DocumentAnnotation) to
> the target CAS
> * create the CasCopier with the source and target CAS
> * copy several FSes but *not* the document annotation
> Expected:
> * target CAS contains 1 DocumentMetaData annotation
> Actual
> * target CAS contains 2 DocumentMetaData annotation
> Also, it seems that `isDocumentAnnotation` may not able to handle it if a CAS
> uses a custom subclass of DocumentAnnotation:
> {noformat}
> private <T extends FeatureStructure> boolean isDocumentAnnotation(T aFS) {
> if (((TOP)aFS)._getTypeCode() != TypeSystemConstants.docTypeCode) {
> return false;
> }
> if (srcCasDocumentAnnotation == null) {
> srcCasDocumentAnnotation =
> srcCasViewImpl.getDocumentAnnotationNoCreate();
> }
> return aFS == srcCasDocumentAnnotation;
> }
> {noformat}
--
This message was sent by Atlassian JIRA
(v6.4.14#64029)