[ https://issues.apache.org/jira/browse/UIMA-5115?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15507764#comment-15507764 ]
Marshall Schor commented on UIMA-5115: -------------------------------------- Re: type is inferred from the variable to which the result is assigned - yes that works. For compile-time type safety, you can use the form: {code} // a method in the CAS <T extends FeatureStructure> SelectFSs<T> select(Class<T> clazz)... // a use of this method SelectFSs<MyJCasType> s = cas.select(MyJCasType.class); {code} The compiler checks that the class of the argument matches the type argument in the receiver declaration. I agree that if you use cas.select("pkg.MyJCasType"), there's no compile-time checking done. > 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)