<div dir="ltr"><div dir="ltr"><div class="gmail_default"><span style="font-family:monospace">Hello Maurizio,</span></div><div class="gmail_default"><span style="font-family:monospace"><br></span></div><div class="gmail_default"><span style="font-family:monospace">Thank you for your response!</span></div><div class="gmail_default"><span style="font-family:monospace"><br></span></div><div class="gmail_default"><span style="font-family:monospace">> 
sadly I don’t know the answer to your question</span></div><div class="gmail_default"><span style="font-family:monospace">> as I wasn’t
        around when enums were added to the</span></div><div class="gmail_default"><span style="font-family:monospace">> language ;-)

</span></div><div class="gmail_default"><span style="font-family:monospace"><br></span></div><div class="gmail_default"><span style="font-family:monospace">Lol, fair enough. I actually poked around the enum class itself [1] and saw that it was originally made by at least 2 folks - Josh Bloch and Neal Gafter. Maybe they read these mailing lists on occasion?</span></div><div class="gmail_default"><span style="font-family:monospace"><br></span></div><div class="gmail_default"><span style="font-family:monospace">> 
I agree with all
        Brian said. I’d also add that</span></div><div class="gmail_default"><span style="font-family:monospace">> the failure modes we discovered
        when we worked</span></div><div class="gmail_default"><span style="font-family:monospace">> on generic enums are rather obscure, as they</span></div><div class="gmail_default"><span style="font-family:monospace">> are
        a result of <em>three</em> factors: (i) you need to</span></div><div class="gmail_default"><span style="font-family:monospace">> have some
        class Foo that is transitioning from</span></div><div class="gmail_default"><span style="font-family:monospace">> being non-generic to being
        generic and (ii) you</span></div><div class="gmail_default"><span style="font-family:monospace">> have to have some existing utterances of
        Foo</span></div><div class="gmail_default"><span style="font-family:monospace">> nested inside some other parameterized type</span></div><div class="gmail_default"><span style="font-family:monospace">> (e.g. <code style="font-size:0.85em;margin:0px 0.15em;padding:0px 0.3em;white-space:pre-wrap;border:1px solid rgb(234,234,234);background-color:rgb(248,248,248);border-radius:3px;display:inline">Box<Foo></code>)
          and (iii) the declaration of</span></div><div class="gmail_default"><span style="font-family:monospace">> that second generic class has to
          be</span></div><div class="gmail_default"><span style="font-family:monospace">> sufficiently strict (e.g. <code style="font-size:0.85em;margin:0px 0.15em;padding:0px 0.3em;white-space:pre-wrap;border:1px solid rgb(234,234,234);background-color:rgb(248,248,248);border-radius:3px;display:inline">Box<X extends Foo<X>></code>).</span></div><div class="gmail_default"><span style="font-family:monospace">> If <em>all</em> these conditions are met, then you end</span></div><div class="gmail_default"><span style="font-family:monospace">> up
          with cases where utterances of <code style="font-size:0.85em;margin:0px 0.15em;padding:0px 0.3em;white-space:pre-wrap;border:1px solid rgb(234,234,234);background-color:rgb(248,248,248);border-radius:3px;display:inline">Box<Foo></code></span></div><div class="gmail_default"><span style="font-family:monospace">> were valid before generification of Foo, but</span></div><div class="gmail_default"><span style="font-family:monospace">> invalid
            afterwards. Something like this was</span></div><div class="gmail_default"><span style="font-family:monospace">> (and still is!) pretty
            hard to spot. <br></span></div><div class="gmail_default"><span style="font-family:monospace"><br></span></div><div class="gmail_default"><span style="font-family:monospace">Thank you so much for the context. This really clarifies a lot and helps me to understand even more the hesitation to push forward. Not only is it going to break code, but the scope at which it will is difficult to measure, so we can't accurately judge the cost to the benefit.</span></div><div class="gmail_default"><span style="font-family:monospace"><br></span></div><div class="gmail_default"><span style="font-family:monospace">> 
One might argue
        (given what we know now) that</span></div><div class="gmail_default"><span style="font-family:monospace">> it would have been perhaps better
        not to make</span></div><div class="gmail_default"><span style="font-family:monospace">> the Enum class itself generic. But the static</span></div><div class="gmail_default"><span style="font-family:monospace">> type
        checking you get on stuff like</span></div><div class="gmail_default"><span style="font-family:monospace">> <code style="font-size:0.85em;margin:0px 0.15em;padding:0px 0.3em;white-space:pre-wrap;border:1px solid rgb(234,234,234);background-color:rgb(248,248,248);border-radius:3px;display:inline">EnumSet.noneOf(Foo.class)</code>
        is hard to pass up: if</span></div><div class="gmail_default"><span style="font-family:monospace">> <code style="font-size:0.85em;margin:0px 0.15em;padding:0px 0.3em;white-space:pre-wrap;border:1px solid rgb(234,234,234);background-color:rgb(248,248,248);border-radius:3px;display:inline">Enum</code>
        wasn’t a generic class, then there’d be no</span></div><div class="gmail_default"><span style="font-family:monospace">> way to tie the type
        of the class literal to the</span></div><div class="gmail_default"><span style="font-family:monospace">> type of the returned EnumSet. So I
        think the</span></div><div class="gmail_default"><span style="font-family:monospace">> Enum generic declaration we ended up with is the</span></div><div class="gmail_default"><span style="font-family:monospace">> result of a forced move (type-system wise).

</span></div></div><div><span style="font-family:monospace"><br></span></div><div><div class="gmail_default"><span style="font-family:monospace">One thing being on this mailing list has taught me is that it is all about tradeoffs when trying to figure out whether or not to put stuff into the language, let alone how. I definitely see what you mean now.</span></div><div class="gmail_default"><span style="font-family:monospace"><br></span></div><div class="gmail_default"><span style="font-family:monospace">Thank you for the insight and context!</span></div><div><span style="font-family:monospace">David Alayache<span class="gmail_default" style="font-family:monospace">w</span></span>
      </div></div></div>