title: Deprecation warning while implement HttpSession
body: <p>While I'm trying to implement HttpSession, I should override <code>getSessionContext</code> method. But it casues deprecated warnings because the method and its return type <code>HttpSessionContext</code> is deprecated.</p>
  
  <p><code>@deprecated</code> javadoc tag fixes a warning on the definition of <code>getSessionContext</code> but cannot fix a warning on the import of <code>HttpSessionContext</code>. And putting <code>@SuppressWarnings</code> before the import causes a compile error.</p>
  
  <p>How can I fix both of the warnings?</p>
  
  <p>Code:</p>
  
  <pre><code>import javax.servlet.http.HttpSession;
  import javax.servlet.http.HttpSessionContext;
  
  public class MyServletSession implements HttpSession {
      // ...
  
      /**
       * @deprecated
       */
      @Override
      public HttpSessionContext getSessionContext() {
          throw new UnsupportedOperationException();
      }
  
      // ...
  }
  </code></pre>
  
  <p>Warning:</p>
  
  <pre><code>$ javac -Xlint:deprecation -cp /path/to/javax.servlet-api-3.0.1.jar MyServletSession.java
  MyServletSession.java:5: warning: [deprecation] HttpSessionContext in javax.servlet.http has been deprecated
  import javax.servlet.http.HttpSessionContext;
                                       ^
  1 warning
  </code></pre>