accumulo-notifications mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Christopher Tubbs (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (ACCUMULO-2486) Use covariant return types in SKVI.deepCopy
Date Mon, 17 Mar 2014 22:14:53 GMT

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

Christopher Tubbs commented on ACCUMULO-2486:
---------------------------------------------

No strong opinion here. It seems like it makes sense in many cases, such as in the example,
but we should think about the implications on the API semantics whenever we do something like
that. In this case, it makes sense because we expect users to not just use the interfaces...
we also expect that they'll subclass the iterators.

> Use covariant return types in SKVI.deepCopy
> -------------------------------------------
>
>                 Key: ACCUMULO-2486
>                 URL: https://issues.apache.org/jira/browse/ACCUMULO-2486
>             Project: Accumulo
>          Issue Type: Improvement
>            Reporter: Mike Drob
>             Fix For: 1.7.0
>
>
> Starting with Java 5, subclasses with method overrides can declare covariant return types.
In general, I believe that we want to do this, as it provides stronger type guarantees with
not a lot of extra cost.
> Example:
> {code}
> public interface SortedKeyValueIterator {
>       SortedKeyValueIterator deepCopy(IteratorEnvironment env);
> }
> public interface InterruptibleIterator extends SortedKeyValueIterator {
>       @Override
>       InterruptibleIterator deepCopy(IteratorEnvironment env);
> }
> {code}
> I believe this change will be fully backwards compatible with the existing APIs.



--
This message was sent by Atlassian JIRA
(v6.2#6252)

Mime
View raw message