[
https://issues.apache.org/jira/browse/ACCUMULO-2486?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13940650#comment-13940650
]
Mike Drob commented on ACCUMULO-2486:
-------------------------------------
Just realized that this *would* be breaking API for any users that have custom
iterators which extend one of our subclasses, because their deepCopy method
signature likely returns SKVI instead of the proper type.
> 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)