Overriding non-parameterized classes nested in a parameterized outer class in Java
<p>Can someone please help with the syntax of subclassing a non-parameterized nested class inside a parameterized outer class, like the following?</p>

<pre><code>public abstract class Foo&lt;T&gt; {

    public class Bar {
        Set&lt;T&gt; aSet;
    }

    abstract class Baz {
        abstract void doSomething(Map&lt;? extends Bar, T&gt; aMap);
    } 
}
</code></pre>

<p>Then in a separate file, I'm not entirely sure how to define the type variable <code>S</code> here without parameterizing <code>ConcreteBaz</code>. And I can't use a wildcard variable like <code>extends Foo&lt;?&gt;.Baz</code> (I think) because I need access to that generic type variable in the <code>doSomething</code> method:</p>

<pre><code>public class ConcreteBaz extends Foo&lt;S&gt;.Baz {    // compilation error

    public ConcreteBaz(Foo&lt;S&gt; foo) { foo.super(); }

    public void doSomething(Map&lt;? extends Foo&lt;S&gt;.Bar, S&gt; aMap) { ... }

}
</code></pre>

<p>Can someone please help me figure out a way around this? Thanks.</p>
