You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@uima.apache.org by "Marshall Schor (JIRA)" <de...@uima.apache.org> on 2015/10/29 16:13:28 UTC

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

Marshall Schor created UIMA-4669:
------------------------------------

             Summary: 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
            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
(v6.3.4#6332)