[ 
https://issues.apache.org/jira/browse/UIMA-826?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12577530#action_12577530
 ] 

Adam Lally commented on UIMA-826:
---------------------------------

Fixed the problem with type names starting with "uima.", but there is now 
another issue. If I create a type system descriptor that imports the two 
descriptors above, and try to call CasCreationUtils.createCas(tsDesc, null, 
null) passing that descriptor, it fails with a message telling me that I can't 
redefine the supertype of a builtin type.

I think the problem is that mergeTypeSystems is not called in the case where 
you have a single type system descriptor. But if that descriptor imports things 
with differing definitions, then a merge is really needed. I think a lot of 
these cases slipped by before, but the new check for redefined types exposed 
them.

I think CasCreationUtils.createCas(TypeSystemDescription, TypePriorities, 
FsIndexDescription[]) needs to call mergeTypeSystems.

> Type System Merging does not work consistently when a type is declared twice 
> with different supertypes
> ------------------------------------------------------------------------------------------------------
>
>                 Key: UIMA-826
>                 URL: https://issues.apache.org/jira/browse/UIMA-826
>             Project: UIMA
>          Issue Type: Bug
>          Components: Core Java Framework
>    Affects Versions: 2.2.1
>            Reporter: Adam Lally
>            Assignee: Adam Lally
>             Fix For: 2.2.2
>
>
> 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.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply via email to