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)

Reply via email to