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 2020/09/15 17:34:00 UTC

[jira] [Commented] (UIMA-4669) UV3 Internal - change some APIs to return more specific subclass

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

Richard Eckart de Castilho commented on UIMA-4669:
--------------------------------------------------

[~schor] what is the status of this issue?

> UV3 Internal - change some APIs to return more specific subclass
> ----------------------------------------------------------------
>
>                 Key: UIMA-4669
>                 URL: https://issues.apache.org/jira/browse/UIMA-4669
>             Project: UIMA
>          Issue Type: Improvement
>          Components: Core Java Framework
>            Reporter: Marshall Schor
>            Priority: Minor
>
> A method which always returns an instance of class C can be specified in the API to return an instance of C or any of its superclasses.  Change the return type to be C instead of one of the superclasses, because
>   - the user who is expecting the supertype will still work and cost nothing (a "Widening Reference Conversion")
>   - users who need the subtype would otherwise need to cast back to the subtype - which is a runtime check (unless the JIT can optimize this away).



--
This message was sent by Atlassian Jira
(v8.3.4#803005)