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

Type System Merging does not work consistently when a type is declared twice with different supertypes

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 2.2.1
    • 2.2.2
    • Core Java Framework
    • None

    Description

      When type system merging is done, if the same type is declared twice with different supertypes, then the result depends on the order in which the types are declared.

      For example, given the type system descriptors:
      TS1.xml:
      <typeSystemDescription xmlns="http://uima.apache.org/resourceSpecifier">
      <types>
      <typeDescription>
      <name>Sub</name>
      <description>Example type.</description>
      <supertypeName>uima.tcas.Annotation</supertypeName>
      </typeDescription>
      </types>
      </typeSystemDescription>

      TS2.xml:
      <typeSystemDescription xmlns="http://uima.apache.org/resourceSpecifier">
      <types>
      <typeDescription>
      <name>Sub</name>
      <description>Example type.</description>
      <supertypeName>Super</supertypeName>
      </typeDescription>
      <typeDescription>
      <name>Super</name>
      <description>Example type.</description>
      <supertypeName>uima.tcas.Annotation</supertypeName>
      </typeDescription>
      </types>
      </typeSystemDescription>

      If you merge them in the order TS1.xml, TS2.xml it will fail with the error message: "The Type Sub is declared twice, with incompatible supertypes Super and uima.tcas.Annotation". But if you merge them in the order TS2.xml, TS1.xml it will succeed!

      The intended behavior is that the merge should succeed and the resulting supertype should be "Super" (the lower of the two declared supertypes in the type hierarchy). It is only supposed to fail if the different declared supertypes are not in the same inheritance chain (neither inherits from the other). But that code is broken in the case where the two subtype declarations are processed before the supertype declarations.

      Attachments

        Activity

          People

            alally Adam P. Lally
            alally Adam P. Lally
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: