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

Thilo Goetz reopened UIMA-1352:
-------------------------------


As Marshall discovered, this fix breaks other code.  The issue is that 
different parts of our code make different assumptions about how the findKey() 
method in the index implementations is supposed to work.  The code that is now 
broken assumes that findKey() returns a node in the index tree, while the code 
that was broken before assumes it returns a key.  Because both are ints, this 
difference in interpretation does not cause a compile error and only shows up 
at runtime.  

> java.lang.ClassCastException using find() with a SET index
> ----------------------------------------------------------
>
>                 Key: UIMA-1352
>                 URL: https://issues.apache.org/jira/browse/UIMA-1352
>             Project: UIMA
>          Issue Type: Bug
>          Components: Core Java Framework
>    Affects Versions: 2.2.2
>         Environment: Linux openSUSE 10.2
>            Reporter: Pablo D.
>            Assignee: Thilo Goetz
>             Fix For: 2.3
>
>         Attachments: uima_test.zip
>
>
> It is not possible to use the FSIndex.find() method when the indexing 
> strategy is a SET.
> A java.lang.ClassCastException is thrown.
> For example:
> FSIndex idx = aJCas.getJFSIndexRepository().getIndex("idx_SET");
> while (doSomething) {
>    MyFeatureStructure myFs = new MyFeatureStructure(aJCas);
>    myFs.setMyFeature(value);
>    myFs.addToIndexes();
>  
>    // Try to recover from index    
>    MyFeatureStructure otherFs = (MyFeatureStructure)idx.find(myFs);  // 
> ClassCastException !!!!
>    ...
> }

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