[ 
https://issues.apache.org/jira/browse/UIMA-3513?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Marshall Schor reopened UIMA-3513:
----------------------------------


Burn ran a test with Java "assertions" enabled ( -ea as a JVM argument).  This 
caused one of the assertions in the CasCopier to trip.  This assertion was 
checking if a Feature Structure's reference to the CAS is the same as the CAS 
it's supposed to be in. 

If the situation is that the FS is added to the CAS *before* the CAS is 
wrapped, then the reference is not equal, of course, and the assertion trips.

This can be fixed in the CasCopier by getting a reference to the wrapped CAS.  
One (unreliable?) technique that works in both cases I know of CAS wrapping is 
to use:
{code}cas1 = (CAS) cas1.getLowLevelCas();{code}
This of course depends on the wrapper implementing getLowLevelCAS() as a foward 
to the same method on the wrapped CAS.  

> CasCoper test for views belonging to same CAS broken
> ----------------------------------------------------
>
>                 Key: UIMA-3513
>                 URL: https://issues.apache.org/jira/browse/UIMA-3513
>             Project: UIMA
>          Issue Type: Bug
>          Components: Core Java Framework
>    Affects Versions: 2.4.2SDK
>            Reporter: Marshall Schor
>            Assignee: Marshall Schor
>             Fix For: 2.5.0SDK
>
>
> The logic is flawed.  Example 1: if cas1's viewname and cas2's viewname are 
> both null (could be both base CASes, I think), then it returns the result of 
> null == null because it's comparing the viewnames (null strings) instead of 
> the base CASes themselves.
> The tests further may fail if the CAS is wrapped.  May need to use "equals" 
> instead of == , but need to check the default impl of this.



--
This message was sent by Atlassian JIRA
(v6.1.5#6160)

Reply via email to