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

APIs for adding new feature to type are inconsistent in defaulting multipleReferencesAllowed, leading to merge failures

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 2.3.1SDK
    • 2.4.0SDK
    • Core Java Framework
    • None

    Description

      The method addFeature(...) on TypeSystemImpl, when the boolean multipleReferencesAllowed is not specified as an argument, default this to "true".

      The method addFeature(...) on an instance of TypeDescriptionImpl, when multipleReferencesAllowed is not specified as an argument, default this to "null".

      CasCreationUtils mergeFeatures(...) throws a ResourceInitializationException saying INCOMPATIBLE_MULTI_REFS if a feature is has multipleReferencesAllowed as true in one, and "null" in the other. The comment in the code says that "false" is the default.

      The use case driving this is reported in http://mail-archives.apache.org/mod_mbox/uima-user/201101.mbox/%3C267885741.1859849.1296090121503.JavaMail.root@sz0143a.emeryville.ca.mail.comcast.net%3E.

      There are multiple ways to fix this. The actual type stores the value of multipleReferencesAllowed as a "boolean", so "null" is not an option. So, we can't change the value of the multipleReferencesAllowed default to match what happens in TypeDescriptionImpl, namely, to set the value to "null".

      Try changing the merge code to allow merging if the feature is not an array or a List (because multipleReferencesAllowed is only used for those cases). Or, change callers of the addFeature(...) in TypeSystemImpl to explicitly set the multipleReferencesAllowed to false if the range cannot be a list element or an array.

      Attachments

        Activity

          People

            schor Marshall Schor
            schor Marshall Schor
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: