RFR: 8211138: Missing Flag enum constants

Maurizio Cimadamore maurizio.cimadamore at oracle.com
Wed Sep 26 13:59:43 UTC 2018



On 26/09/18 05:42, Liam Miller-Cushon wrote:
> On Mon, Sep 24, 2018 at 8:29 AM Maurizio Cimadamore 
> <maurizio.cimadamore at oracle.com 
> <mailto:maurizio.cimadamore at oracle.com>> wrote:
>
>     Which leaves out ANONCONSTR_BASED and POTENTIALLY_AMBIGUOUS, which
>     should indeed be added to avoid spurious assertion failures.
>
>
> I put together a patch and created a simple test to ensure the enum 
> constants are kept in sync:
>
> webrev: http://cr.openjdk.java.net/~cushon/8211138/webrev.00/ 
> <http://cr.openjdk.java.net/%7Ecushon/8211138/webrev.00/>
> bug: https://bugs.openjdk.java.net/browse/JDK-8211138
>
> I wonder if there are good options for preventing this mistake 
> statically, instead of with a test. (e.g. using EnumSets, but maybe 
> that's a non-starter for performance reasons?)
Thanks, looks good.

We have discussed internally to replace flags with an enum. I'll polish 
that email and share it here, since it's related

Maurizio
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.openjdk.java.net/pipermail/compiler-dev/attachments/20180926/8419fefb/attachment.html>


More information about the compiler-dev mailing list