Uploaded image for project: 'UIMA'
  1. UIMA
  2. UIMA-5601

uv3: CasCopier problems with custom subclasses of DocumentAnnotation

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • 3.0.0SDK-beta
    • 3.0.0SDK
    • Core Java Framework
    • None

    Description

      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:

        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;
        }
      

      Attachments

        Activity

          People

            schor Marshall Schor
            rec Richard Eckart de Castilho
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: