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

Marshall Schor commented on UIMA-5115:
--------------------------------------

This bit of uglyness is due to the fact that type inference from the target to 
the method doesn't "chain".  However it can be overcome more simply than 
passing extra arguments.  I did this experiment:

{code}
// fails - can't convert FSIterator<TOP> to FSIterator<Token>
FSIterator<Token> it = cas.select("my.Token").fsIterator();

// split into two statements, and it works (no chained inference needed)
SelectFS<Token> s = cas.select("my.Token"); //OK
FSIterator<Token> it2 = s.fsIterator();     //OK

// simple work-around for non-chaining type inferencing - supply the type
FSIterator<Token> it3 = cas.<Token>select("my.Token").fsIterator();
{code}

An internet search yielded this article by John Rose: 
http://mail.openjdk.java.net/pipermail/lambda-dev/2013-July/010531.html


> uv3 select() api for iterators and streams over CAS contents
> ------------------------------------------------------------
>
>                 Key: UIMA-5115
>                 URL: https://issues.apache.org/jira/browse/UIMA-5115
>             Project: UIMA
>          Issue Type: New Feature
>          Components: Core Java Framework
>            Reporter: Marshall Schor
>            Priority: Minor
>             Fix For: 3.0.0SDKexp
>
>
> Design and implement a select() API based on uimaFIT's select, integrated 
> well with Java 8 concepts.  Initial discussions in UIMA-1524.  Wiki with 
> diagram: https://cwiki.apache.org/confluence/display/UIMA/UV3+Iterator+support



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to