Community
Participate
Working Groups
Just as with booleans, the values of an enum could benefit from packing them into bit flags.
Created attachment 95812 [details] Patches to support GenModel.packedEnums
Created attachment 95813 [details] Better handling of straddling condition
Created attachment 95814 [details] Sample project for testing
Dave, here's the packed enum thing we talked about.
Created attachment 96060 [details] Updated patch against latest version of head. Dave, the only other things I was thinking I would add is instead of doing EnumType.values()[ordinal] or (EnumType)EnumType.VALUES.get(ordinal) store the typed array in a private field and use that. This avoids method calls (likely EnumType.values() creates a new array) and casting, in the case of Java 1.4.
The computation of flag sizes was a little bit generous (allocating an extra bit in some cases), so I fixed that. I also improved the flag mask computation and moved it into GenClass, where it's much more readable. The enhancement is committed to CVS for EMF 2.4.
Fix available in HEAD: Alyssa (I200804200420).