<head><!-- BaNnErBlUrFlE-HeAdEr-start -->
<style>
#pfptBannerkcruezh { all: revert !important; display: block !important;
visibility: visible !important; opacity: 1 !important;
background-color: #60beeb !important;
max-width: none !important; max-height: none !important }
.pfptPrimaryButtonkcruezh:hover, .pfptPrimaryButtonkcruezh:focus {
background-color: #77a8c4 !important; }
.pfptPrimaryButtonkcruezh:active {
background-color: #8193a0 !important; }
html:root, html:root>body { all: revert !important; display: block !important;
visibility: visible !important; opacity: 1 !important; }
</style>
<!-- BaNnErBlUrFlE-HeAdEr-end -->
</head><!-- BaNnErBlUrFlE-BoDy-start -->
<!-- Preheader Text : BEGIN -->
<div style="display:none !important;display:none;visibility:hidden;mso-hide:all;font-size:1px;color:#ffffff;line-height:1px;max-height:0px;opacity:0;overflow:hidden;">
On Tue, Feb 24, 2026 at 7: 17 AM Clement Cherlin <ccherlin@ gmail. com> wrote: On Mon, Feb 23, 2026 at 6: 26 AM Maurizio Cimadamore <maurizio. cimadamore@ oracle. com> wrote: Hi Clement On 22/02/2026 18: 21, Clement Cherlin wrote: ></div>
<!-- Preheader Text : END -->
<!-- Email Banner : BEGIN -->
<div style="display:none !important;display:none;visibility:hidden;mso-hide:all;font-size:1px;color:#ffffff;line-height:1px;max-height:0px;opacity:0;overflow:hidden;">ZjQcmQRYFpfptBannerStart</div>
<!--[if ((ie)|(mso))]>
<table border="0" cellspacing="0" cellpadding="0" width="100%" style="padding: 0px 0px 10px 0px; direction: ltr" lang="en"><tr><td>
<table border="0" cellspacing="0" cellpadding="0" style="padding: 0px 8px 6px 8px; width: 100%; border-radius:4px; border-top:4px solid #8193a0;background-color:#60beeb;"><tr><td valign="top">
<table align="left" border="0" cellspacing="0" cellpadding="0" style="padding: 0px 8px 4px 8px; font-size: 12px; line-height: 16px">
<tr><td style="color:#000000; font-family: 'Arial', sans-serif; font-weight:bold; font-size:14px; line-height: 20px; direction: ltr">
This Message Is From an External Sender
</td></tr>
<tr><td style="color:#000000; font-weight:normal; font-family: 'Arial', sans-serif; font-size:12px; direction: ltr">
This message came from outside your organization.
</td></tr>
</table>
<![if ie]><br clear="all"><![endif]>
<table align="right" border="0" cellspacing="0" cellpadding="0" style="padding: 0px 0px 4px 0px; font-size: 14px; line-height: 36px"><tr>
<td style="direction: ltr"> <a target="_blank" href="https://us-phishalarm-ewt.proofpoint.com/EWT/v1/ACWV5N9M2RV99hQ!Op20OCbCsYaHHT1LlLhV24sfTw-_2Wl2rGABiuxhAN8whw5NYPG1dWd-q9k3IQiRATFvuoVagXUFB0gmn7pXmPNsN8sqBEWv16ulf2yBLpBSKJVzCqV_NFCul-hwlvI$" style="mso-padding-alt: 7px; padding: 7px; border-radius: 2px; border: 1px solid #666666; "><strong style="font-weight: normal; color: #000000; text-decoration: none; font-family: 'Arial', sans-serif; font-size: 14px;"> Report Suspicious </strong></a> </td>
</tr></table>
</td></tr></table>
</td></tr></table>
<![endif]-->
<![if !((ie)|(mso))]>
<div dir="ltr" lang="en" id="pfptBannerkcruezh" style="all: revert !important; display:block !important; text-align: left !important; margin: 0 0 10px 0 !important; padding:7px 16px 8px 16px !important; border-radius: 4px !important; min-width: 200px !important; background-color: #60beeb !important; background-color: #60beeb; border-top: 4px solid #8193a0 !important; border-top: 4px solid #8193a0;">
<div id="pfptBannerkcruezh" style="all: unset !important; float:left !important; display:block !important; margin: 1px 0 1px 0 !important; max-width: 600px !important;">
<div id="pfptBannerkcruezh" style="all: unset !important; display:block !important; visibility: visible !important; background-color: #60beeb !important; color:#000000 !important; color:#000000; font-family: 'Arial', sans-serif !important; font-family: 'Arial', sans-serif; font-weight:bold !important; font-weight:bold; font-size:14px !important; line-height:1.29 !important; line-height:1.29">
This Message Is From an External Sender
</div>
<div id="pfptBannerkcruezh" style="all: unset !important; display:block !important; visibility: visible !important; background-color: #60beeb !important; color:#000000 !important; color:#000000; font-weight:normal; font-family: 'Arial', sans-serif !important; font-family: 'Arial', sans-serif; font-size:12px !important; line-height:1.5 !important; line-height:1.5; margin-top:2px !important;">
This message came from outside your organization.
</div>
</div>
<div id="pfptBannerkcruezh" style="all: unset !important; float: right !important; display: block !important; display: block; margin-left: 16px !important; margin-top: 1px !important; text-align: right !important; width: fit-content !important; font-size: 12px !important">
<a id="pfptBannerkcruezh" href="https://us-phishalarm-ewt.proofpoint.com/EWT/v1/ACWV5N9M2RV99hQ!Op20OCbCsYaHHT1LlLhV24sfTw-_2Wl2rGABiuxhAN8whw5NYPG1dWd-q9k3IQiRATFvuoVagXUFB0gmn7pXmPNsN8sqBEWv16ulf2yBLpBSKJVzCqV_NFCul-hwlvI$"
style="all: unset !important; display: inline-block !important; text-decoration: none">
<div class="pfptPrimaryButtonkcruezh" style="display: inline-block !important; display: inline-block; visibility: visible !important; opacity: 1 !important; color: #000000 !important; color: #000000; font-family: 'Arial', sans-serif !important; font-family: 'Arial', sans-serif; font-size: 14px !important; font-weight: normal !important; text-decoration: none !important; border-radius: 2px !important; margin-top: 3px !important; margin-bottom: 3px !important; margin-left: 16px !important; padding: 7.5px 16px !important; white-space: nowrap !important; width: fit-content !important;
border: 1px solid #666666">
Report Suspicious
</div>
</a>
</div>
<div style="clear: both !important; display: block !important; visibility: hidden !important; line-height: 0 !important; font-size: 0.01px !important; height: 0px"> </div>
</div>
<![endif]>
<div style="display:none !important;display:none;visibility:hidden;mso-hide:all;font-size:1px;color:#ffffff;line-height:1px;max-height:0px;opacity:0;overflow:hidden;">ZjQcmQRYFpfptBannerEnd</div>
<!-- Email Banner : END -->
<!-- BaNnErBlUrFlE-BoDy-end -->
<div dir="ltr"><div dir="ltr">On Tue, Feb 24, 2026 at 7:17 AM Clement Cherlin <<a href="mailto:ccherlin@gmail.com">ccherlin@gmail.com</a>> wrote:</div><div class="gmail_quote gmail_quote_container"><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div class="msg6760644994368145653">
<div style="display:none;font-size:1px;color:rgb(255,255,255);line-height:1px;max-height:0px;opacity:0;overflow:hidden">
On Mon, Feb 23, 2026 at 6: 26 AM Maurizio Cimadamore <maurizio. cimadamore@ oracle. com> wrote: Hi Clement On 22/02/2026 18: 21, Clement Cherlin wrote: > Greetings, > > I have been working on the problem of generic enums off and on</div>
<div style="display:none;font-size:1px;color:rgb(255,255,255);line-height:1px;max-height:0px;opacity:0;overflow:hidden"></div>
<div dir="ltr"><div dir="ltr"><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Mon, Feb 23, 2026 at 6:26 AM Maurizio Cimadamore <<a href="mailto:maurizio.cimadamore@oracle.com" target="_blank">maurizio.cimadamore@oracle.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">> There is one slightly awkward issue. It's not possible to simply pass <br>
> an enum class literal to EnumSet's static factory methods without a <br>
> raw cast.<br>
><br>
> EnumSet.allOf((Class<Option<?>>) (Class) Option.class);<br>
<br>
This makes me more worried -- because this is such a common idiom that <br>
(I think) has to work like for any other enum.</blockquote><div><br></div><div>That's an excellent point. Doing the migration in a single step is source incompatible.</div><div><br></div><div>However, it is possible to perform the migration in multiple steps...</div></div></div></div></div></blockquote><div><br></div><div>I think that would be the wrong direction to take. The cost of dealing with <span style="font-family:monospace">EnumSet.of()</span> and friends should be measured in units of mental taxation, not keystrokes.</div><div><br></div><div>We all agree that <span style="font-family:monospace">(Class<Option<?></span><span style="font-family:monospace">>)(Class)Option.class</span> is ugly from a keystroke point of view, but that's not because <span style="font-family:monospace">Option</span> is an enum, it's because Java class literals are erased. In that respect, <span style="font-family:monospace">EnumSet.allOf()</span> is no different from any other method that takes a <span style="font-family:monospace">Class</span> parameter.</div><div><br></div><div>So from a mental taxation point of view, having to do that cast adds no new mental cost - Java developers already have baked into their brain when and why you have to do it.</div><div><br></div><div>Speaking for myself as a developer, I would gladly pay the above keystroke cost if that was all it took to allow enums to be generic. Surely there must be a more compelling reason why we can't genericize enums...?</div><div><br></div><div>-Archie</div><div> </div></div><span class="gmail_signature_prefix">-- </span><br><div dir="ltr" class="gmail_signature">Archie L. Cobbs<br></div></div>