Uploaded image for project: 'Accumulo'
  1. Accumulo
  2. ACCUMULO-2486

Use covariant return types in SKVI.deepCopy

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Resolved
    • Major
    • Resolution: Won't Fix
    • None
    • None
    • None
    • None

    Description

      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:

      public interface SortedKeyValueIterator {
            SortedKeyValueIterator deepCopy(IteratorEnvironment env);
      }
      
      public interface InterruptibleIterator extends SortedKeyValueIterator {
            @Override
            InterruptibleIterator deepCopy(IteratorEnvironment env);
      }
      

      I believe this change will be fully backwards compatible with the existing APIs.

      Attachments

        Activity

          People

            Unassigned Unassigned
            mdrob Mike Drob
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: