title: Can unchecked warnings be avoided when overriding a method with raw type parameters?
body: <p>I am extending a class defined in a library which I cannot change:</p>
  
  <pre><code>public class Parent
  {
      public void init(Map properties) { ... }
  }
  </code></pre>
  
  <p>If I am defining a class 'Child' that extends Parent and I am using Java 6 with generics, what is the best way to override the init method without getting unchecked warnings?</p>
  
  <pre><code>public class Child extends Parent
  {
      // warning: Map is a raw type. References to generic type Map&lt;K,V&gt; should be parameterized
      public void init(Map properties) { }
  }
  </code></pre>
  
  <p>If I add generic parameters, I get:</p>
  
  <pre><code>   // error: The method init(Map&lt;Object,Object&gt;) of type Child has the same erasure as init(Map) of type Parent but does not override it
     public void init(Map&lt;Object,Object&gt;) { ... }
     // same error
     public void init(Map&lt;? extends Object,? extends Object&gt;) { ... }
     // same error
     public void init(Map&lt;?,?&gt;) { ... }
  </code></pre>
  
  <p>This error occurs regardless of whether I use a specific type, a bounded wildcard, or an unbounded wildcard. Is there a correct or idiomatic way to override a non-generic method without warnings, and without using @SuppressWarnings("unchecked")?</p>