You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@uima.apache.org by "Richard Eckart de Castilho (JIRA)" <de...@uima.apache.org> on 2015/05/24 02:52:17 UTC

[jira] [Resolved] (UIMA-3913) JCasUtil methods could be more generic

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

Richard Eckart de Castilho resolved UIMA-3913.
----------------------------------------------
    Resolution: Fixed
      Assignee: Richard Eckart de Castilho

Well observed. I think it doesn't affect source compatibility and the binary-compatibility checker also didn't complain. So the change is in.

> JCasUtil methods could be more generic
> --------------------------------------
>
>                 Key: UIMA-3913
>                 URL: https://issues.apache.org/jira/browse/UIMA-3913
>             Project: UIMA
>          Issue Type: Improvement
>          Components: uimaFIT
>            Reporter: Hugo Mougard
>            Assignee: Richard Eckart de Castilho
>            Priority: Minor
>             Fix For: 2.2.0uimaFIT
>
>
> As an example, the method {{indexCovering}} of {{JCasUtil}} has signature:
> {code}
> public static <T extends Annotation,S extends Annotation> Map<T, Collection<S>> indexCovering(
>   JCas jCas,
>   Class<T> type,
>   Class<S> coveringType)
> {code}
> With this signature, the following code is invalid ({{RevisedSentence}} is a subclass of {{Sentence}}):
> {code}
> Map<RevisedWords, Collection<Sentence>> indexRevised
>                 = JCasUtil.indexCovering(
>                         revised,
>                         RevisedWords.class,
>                         RevisedSentence.class);
> {code}
> This somewhat prevents users of {{JCasUtil}} from benefiting of all the OOP pluses of the UIMA TS.
> Here would be a signature that would maybe better fit the problem:
> {code}
> public static <T extends Annotation, S extends Annotation> Map<T, Collection<S>> indexCovering(
>   JCas jCas,
>   Class<? extends T> type,
>   Class<? extends S> coveringType)
> {code}



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