title: Java: How to avoid deprecated warning in derived interfaces which override deprecated members?
body: <p>Consider the following simplified interface inheritence hierarchy:</p>
  
  <pre><code>// Starting point:
  public interface Base {
      void Foo();
  }
  
  public interface Derived extends Base {
  }
  </code></pre>
  
  <p>It is intended to move the <code>Foo</code> method from the <code>Base</code> interface to the <code>Derived</code> interface:</p>
  
  <pre><code>// Desired end-point:
  public interface Base {
  }
  
  public interface Derived extends Base {
      void Foo();
  }
  </code></pre>
  
  <p>In order to phase in this breaking change, it is desired to retain backwards compatibility of the <code>Base</code> interface for some time.</p>
  
  <p>This can be achieved by marking the method on the <code>Base</code> interface as <code>@Deprecated</code>:</p>
  
  <pre><code>// Intermediate state:
  public interface Base {
      /**
       * @deprecated This method is deprecated as of release X. Derived.Foo should be used instead.
       */
      @Deprecated void Foo();
  }
  
  public interface Derived extends Base {
      void Foo(); 
  }
  </code></pre>
  
  <p>When I compile this code I receive a compiler warning for <strong><code>Derived</code></strong>:</p>
  
  <blockquote>
    <p>[deprecation] Foo() in interface Base has been deprecated</p>
  </blockquote>
  
  <p>Oddly, if I remove the <code>@deprecated</code> from the documentation in <code>Base</code> (but leave the @Deprecated) this warning disappears.</p>
  
  <p>Is it correct that I get this warning, and if so, how can I work around this?</p>
  
  <hr>
  
  <p>The warning seems to communicate that <code>Derived.Foo</code> is "using" <code>Base.Foo</code> (which is deprecated). But the only capacity in which <code>Derived.Foo</code> is "using" the deprecated <code>Base.Foo</code> is to override it. That seems to say that you are not allowed to override deprecated interface methods in derived methods.</p>
  
  <p>If this is the case, should I then decorate <code>Derived</code> with <code>@SuppressWarnings("deprecation")</code> to suppress the warning?</p>